Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python ImportError:部署到openshift时无法导入名称查找规范_Python_Django_Openshift_Openshift Cartridge_Cartridge - Fatal编程技术网

Python ImportError:部署到openshift时无法导入名称查找规范

Python ImportError:部署到openshift时无法导入名称查找规范,python,django,openshift,openshift-cartridge,cartridge,Python,Django,Openshift,Openshift Cartridge,Cartridge,我正试图使用python3.3在openshift部署我的Django项目(因为我的项目只针对python3)。在这里,我们发现一个错误ImportError:当我检查日志文件时,无法导入name find\u spec [Wed Jul 19 10:53:25 2017] [error] [client 127.2.83.1] from django.utils.module_loading import import_string [Wed Jul 19 10:53:25 2017] [er

我正试图使用python3.3在openshift部署我的Django项目(因为我的项目只针对python3)。在这里,我们发现一个错误
ImportError:当我检查日志文件时,无法导入name find\u spec

[Wed Jul 19 10:53:25 2017] [error] [client 127.2.83.1] from django.utils.module_loading import import_string
[Wed Jul 19 10:53:25 2017] [error] [client 127.2.83.1] File "/var/lib/openshift/596f5f3822s71edsf000ad/python/virtenv/venv/lib/python3.3/site-packages/django/utils/module_loading.py", line 67, in <module>
[Wed Jul 19 10:53:25 2017] [error] [client 127.2.83.1] from importlib.util import find_spec as importlib_find
[Wed Jul 19 10:53:25 2017] [error] [client 127.2.83.1] ImportError: cannot import name find_spec
当我检查墨盒时,Python 3.5不可用:

➜  openshift git:(openshift) rhc app create
When creating an application, you must provide a name and a cartridge from the list below:

Short Name           Full name
==========           =========
diy-0.1              Do-It-Yourself 0.1
jbossas-7            JBoss Application Server 7
jboss-dv-6.1.0       JBoss Data Virtualization 6
jbosseap-6           JBoss Enterprise Application Platform 6
jboss-unified-push-1 JBoss Unified Push Server 1.0.0.Beta1
jboss-unified-push-2 JBoss Unified Push Server 1.0.0.Beta2
jenkins-1            Jenkins Server
nodejs-0.10          Node.js 0.10
perl-5.10            Perl 5.10
php-5.3              PHP 5.3
php-5.4              PHP 5.4
zend-6.1             PHP 5.4 with Zend Server 6.1
python-2.6           Python 2.6
python-2.7           Python 2.7
python-3.3           Python 3.3
ruby-1.8             Ruby 1.8
ruby-1.9             Ruby 1.9
ruby-2.0             Ruby 2.0
jbossews-1.0         Tomcat 6 (JBoss EWS 1.0)
jbossews-2.0         Tomcat 7 (JBoss EWS 2.0)
jboss-vertx-2.1      Vert.x 2.1
jboss-wildfly-10     WildFly Application Server 10
jboss-wildfly-8      WildFly Application Server 8.2.1.Final
jboss-wildfly-9      WildFly Application Server 9

有什么办法处理这个问题吗?类似于将python版本升级到python 3.5或其他版本?

您可以使用Django 1.8 LTS,OpenShift 2不会更新python版本。考虑到OpenSHIFT 3。谢谢大家的建议,我想转到OpenSHIFT 3更好。目前正在使用Django 1.11,并排队等待提供给Openshift 3。
➜  openshift git:(openshift) rhc app create
When creating an application, you must provide a name and a cartridge from the list below:

Short Name           Full name
==========           =========
diy-0.1              Do-It-Yourself 0.1
jbossas-7            JBoss Application Server 7
jboss-dv-6.1.0       JBoss Data Virtualization 6
jbosseap-6           JBoss Enterprise Application Platform 6
jboss-unified-push-1 JBoss Unified Push Server 1.0.0.Beta1
jboss-unified-push-2 JBoss Unified Push Server 1.0.0.Beta2
jenkins-1            Jenkins Server
nodejs-0.10          Node.js 0.10
perl-5.10            Perl 5.10
php-5.3              PHP 5.3
php-5.4              PHP 5.4
zend-6.1             PHP 5.4 with Zend Server 6.1
python-2.6           Python 2.6
python-2.7           Python 2.7
python-3.3           Python 3.3
ruby-1.8             Ruby 1.8
ruby-1.9             Ruby 1.9
ruby-2.0             Ruby 2.0
jbossews-1.0         Tomcat 6 (JBoss EWS 1.0)
jbossews-2.0         Tomcat 7 (JBoss EWS 2.0)
jboss-vertx-2.1      Vert.x 2.1
jboss-wildfly-10     WildFly Application Server 10
jboss-wildfly-8      WildFly Application Server 8.2.1.Final
jboss-wildfly-9      WildFly Application Server 9