ImportError:在部署到openshift时无法导入名称find_spec

时间:2017-07-19 15:20:52

标签: python django openshift openshift-cartridge cartridge

我正在尝试使用Python 3.3 在openshift中部署我的Django项目(因为我的项目仅用于python3)。我在检查日志文件时发现错误ImportError: cannot import name find_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

关注这些问题https://stackoverflow.com/a/34648720/6396981https://code.djangoproject.com/ticket/25868。 Django建议升级我的Python,但在这种情况下,openshift仅适用于python 3.3.2。

[myapp-foobar.rhcloud.com 596f5f3822s71edsf000ad]\> python
Python 3.3.2 (default, Aug  5 2016, 06:46:58) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-9)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 

当我检查墨盒时,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或其他东西吗?

0 个答案:

没有答案