首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python2.7突然失灵:“符号未找到:__PyErr_ReplaceException”当我尝试django runserver时

Python2.7突然失灵:“符号未找到:__PyErr_ReplaceException”当我尝试django runserver时
EN

Stack Overflow用户
提问于 2015-08-22 04:02:14
回答 1查看 4.6K关注 0票数 3

问题

我并没有在知情的情况下做任何重大更改,但是突然,当我试图在本地运行django应用程序时,我得到了以下错误:

代码语言:javascript
复制
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ foreman start
03:55:28 web.1  | started with pid 38101
03:55:29 web.1  | Traceback (most recent call last):
03:55:29 web.1  |   File "/Users/macuser/Dropbox/code/heroku/awe01/bin/gunicorn", line 5, in <module>
03:55:29 web.1  |     from pkg_resources import load_entry_point
03:55:29 web.1  |   File "/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/site-packages/pkg_resources.py", line 22, in <module>
03:55:29 web.1  |     import zipfile
03:55:29 web.1  |   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 6, in <module>
03:55:29 web.1  |     import io
03:55:29 web.1  |   File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
03:55:29 web.1  |     import _io
03:55:29 web.1  | ImportError: dlopen(/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyErr_ReplaceException
03:55:29 web.1  |   Referenced from: /Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so
03:55:29 web.1  |   Expected in: flat namespace
03:55:29 web.1  |  in /Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so
03:55:29 web.1  | exited with code 1
03:55:29 system | sending SIGTERM to all processes
SIGTERM received
(awe01)MoriartyMacBookAir13:awesomeapp macuser$

foreman start命令是我总是在本地运行应用程序的方式(基于heroku指令),而不是python manage.py runserver (因此我不知道python manage.py runserver最近是否在工作),但是现在(上面的)错误消息对于foreman startpython manage.py runserver都是一样的。

即使我返回到更早的git提交,也会得到相同的错误,这是foreman start当时使用的一个提交,因此我不认为它是最近添加到我的代码中的新行。相反,python的设置方式似乎发生了一些变化(如果可能的话?)

更多信息

这一切就像在31164285中描述的那样突然发生

我总是在虚拟环境中运行项目,正如您从(awe01)括号中看到的那样

代码语言:javascript
复制
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ which python
/Users/macuser/Dropbox/code/heroku/awe01/bin/python

基于这个线程(31106958),下面的输出可能对某人有用吗?

代码语言:javascript
复制
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ nm /System/Library/Frameworks/Python.framework/Versions/2.7/Python | grep PyErr_ReplaceException
0000000000092b82 T __PyErr_ReplaceException

注意,如果在这个venv中我输入了"python",它就会告诉我我使用的是2.7.6

代码语言:javascript
复制
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ python
Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path
['', '/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/site-packages/feedparser-5.1.2-py2.7.egg', '/Users/macuser/Dropbox/code/heroku/awe01/lib/python27.zip', '/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7', '/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/plat-darwin', '/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/plat-mac', '/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/macuser/Dropbox/code/heroku/awe01/Extras/lib/python', '/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-tk', '/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-old', '/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/site-packages']

brew config输出

代码语言:javascript
复制
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ brew config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 02d219b58d254c0e8bd77a73d901b0e03af13818
Last commit: 5 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit sandybridge
OS X: 10.10.5-x86_64
Xcode: 6.3.2
CLT: N/A
Clang: 6.1 build 602
X11: N/A
System Ruby: 2.0.0-p481
Perl: /usr/bin/perl
Python: /Users/macuser/Dropbox/code/heroku/awe01/bin/python
Ruby: /usr/bin/ruby
Java: 1.8.0_40
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ 

brew doctor输出

代码语言:javascript
复制
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
    /usr/local/include/node/ares.h
    /usr/local/include/node/ares_version.h
    /usr/local/include/node/nameser.h
    /usr/local/include/node/node.h
    /usr/local/include/node/node_buffer.h
    /usr/local/include/node/node_internals.h
    /usr/local/include/node/node_object_wrap.h
    /usr/local/include/node/node_version.h
    /usr/local/include/node/openssl/opensslconf.h
    /usr/local/include/node/uv-private/ngx-queue.h
    /usr/local/include/node/uv-private/stdint-msvc2008.h
    /usr/local/include/node/uv-private/tree.h
    /usr/local/include/node/uv-private/uv-bsd.h
    /usr/local/include/node/uv-private/uv-darwin.h
    /usr/local/include/node/uv-private/uv-linux.h
    /usr/local/include/node/uv-private/uv-sunos.h
    /usr/local/include/node/uv-private/uv-unix.h
    /usr/local/include/node/uv-private/uv-win.h
    /usr/local/include/node/uv.h
    /usr/local/include/node/v8-debug.h
    /usr/local/include/node/v8-preparser.h
    /usr/local/include/node/v8-profiler.h
    /usr/local/include/node/v8-testing.h
    /usr/local/include/node/v8.h
    /usr/local/include/node/v8stdint.h
    /usr/local/include/node/zconf.h
    /usr/local/include/node/zlib.h

Warning: Your Xcode (6.3.2) is outdated
Please update to Xcode 6.4.
Xcode can be updated from the App Store.

Warning: Some keg-only formula are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
`brew link <formula>` will cause other formulae to detect them during
the `./configure` step. This may cause problems when compiling those
other formulae.

Binaries provided by keg-only formulae may override system binaries
with other strange results.

You may wish to `brew unlink` these brews:

    openssl

命令python manage.py shell失败时也有相同的错误,但是当我直接跳入python控制台时,我可以看到导入的工作或不工作(这个线程建议检查urllib2)。

代码语言:javascript
复制
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ python 
Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 94, in <module>
    import httplib
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 80, in <module>
    import mimetools
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/mimetools.py", line 6, in <module>
    import tempfile
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/tempfile.py", line 32, in <module>
    import io as _io
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyErr_ReplaceException
  Referenced from: /Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so   

目前为止的尝试(还没有成功)

1.重新安装python

这是在这里推荐的:https://github.com/SirVer/ultisnips/issues/508和问题31900156

所以我做了以下操作:

代码语言:javascript
复制
brew uninstall python
brew update 
brew install python

它没有解决这个问题。

这告诉我,这不是django或特定于应用程序的问题,而是python问题。下面是卸载和重新安装python后的输出;我在运行pip命令时得到了相同的错误:

代码语言:javascript
复制
 (awe01)MoriartyMacBookAir13:awesomeapp macuser$ brew uninstall python
Uninstalling /usr/local/Cellar/python/2.7.10_2... (6194 files, 96M)
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ brew update
Already up-to-date.
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ brew install python
==> Downloading https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tgz
Already downloaded: /Library/Caches/Homebrew/python-2.7.10.tgz
==> Downloading https://bugs.python.org/file30805/issue10910-workaround.txt
Already downloaded: /Library/Caches/Homebrew/python--patch-c075353337f9ff3ccf8091693d278782fcdff62c113245d8de43c5c7acc57daf.txt
==> Patching
patching file Include/pyport.h
Hunk #1 succeeded at 713 (offset 14 lines).
Hunk #2 succeeded at 736 (offset 14 lines).
==> ./configure --prefix=/usr/local/Cellar/python/2.7.10_2 --enable-ipv6 --datarootdir=/usr/local/Cellar/python/2.7.10_2/share --datadir=/usr/local/Cellar/python/
==> make
==> make install PYTHONAPPSDIR=/usr/local/Cellar/python/2.7.10_2
==> make frameworkinstallextras PYTHONAPPSDIR=/usr/local/Cellar/python/2.7.10_2/share/python
==> Downloading https://pypi.python.org/packages/source/s/setuptools/setuptools-18.0.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/python--setuptools-18.0.1.tar.gz
==> Downloading https://pypi.python.org/packages/source/p/pip/pip-7.1.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/python--pip-7.1.0.tar.gz
==> Downloading https://pypi.python.org/packages/source/w/wheel/wheel-0.24.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/python--wheel-0.24.0.tar.gz
==> /usr/local/Cellar/python/2.7.10_2/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --
==> /usr/local/Cellar/python/2.7.10_2/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --
==> /usr/local/Cellar/python/2.7.10_2/bin/python -s setup.py --no-user-cfg install --force --verbose --single-version-externally-managed --record=installed.txt --
==> Caveats
Pip and setuptools have been installed. To update them
  pip install --upgrade pip setuptools

You can install Python packages with
  pip install <package>

They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages

See: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Homebrew-and-Python.md

.app bundles were installed.
Run `brew linkapps python` to symlink these to /Applications.
==> Summary
  /usr/local/Cellar/python/2.7.10_2: 6194 files, 96M, built in 3.4 minutes
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ pip install --upgrade
Traceback (most recent call last):
  File "/Users/macuser/Dropbox/code/heroku/awe01/bin/pip", line 7, in <module>
    from pip import main
  File "/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/site-packages/pip/__init__.py", line 13, in <module>
    from pip.utils import get_installed_distributions, get_prog
  File "/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/site-packages/pip/utils/__init__.py", line 15, in <module>
    import zipfile
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 6, in <module>
    import io
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyErr_ReplaceException
  Referenced from: /Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ brew linkapps python
Linking /usr/local/opt/python/IDLE.app to /Applications.
Linking /usr/local/opt/python/Python Launcher.app to /Applications.
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ pip install --upgrade
Traceback (most recent call last):
  File "/Users/macuser/Dropbox/code/heroku/awe01/bin/pip", line 7, in <module>
    from pip import main
  File "/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/site-packages/pip/__init__.py", line 13, in <module>
    from pip.utils import get_installed_distributions, get_prog
  File "/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/site-packages/pip/utils/__init__.py", line 15, in <module>
    import zipfile
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py", line 6, in <module>
    import io
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/io.py", line 51, in <module>
    import _io
ImportError: dlopen(/Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so, 2): Symbol not found: __PyErr_ReplaceException
  Referenced from: /Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so
  Expected in: flat namespace
 in /Users/macuser/Dropbox/code/heroku/awe01/lib/python2.7/lib-dynload/_io.so
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ 

我专门检查urllib2的原因是基于对问题的评论-1384

注意,此时安装的python是version 2.7.10_2,但是当我在虚拟env awe01中输入python时,它仍然会带我进入一个版本为2.7.6的shell。

代码语言:javascript
复制
(awe01)MoriartyMacBookAir13:awesomeapp macuser$ python
Python 2.7.6 (default, Sep  9 2014, 15:04:36) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

2.在虚拟env之外开始尝试领班。

这意味着python是系统python,2.7.10

代码语言:javascript
复制
MoriartyMacBookAir13:awesomeapp macuser$ which python
/usr/bin/python

这也失败了,但是我得到了另一条错误消息。

代码语言:javascript
复制
MoriartyMacBookAir13:awesomeapp macuser$ foreman start
04:44:30 web.1  | started with pid 50330
04:44:30 web.1  | /usr/local/foreman/bin/foreman-runner: line 41: exec: gunicorn: not found
04:44:30 web.1  | exited with code 127
04:44:30 system | sending SIGTERM to all processes
SIGTERM received
MoriartyMacBookAir13:awesomeapp macuser$

有趣的是,foreman start错误与此python manage.py runserver错误不同:

代码语言:javascript
复制
MoriartyMacBookAir13:awesomeapp macuser$ python manage.py runserver
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 345, in execute
    settings.INSTALLED_APPS
  File "/Library/Python/2.7/site-packages/django/conf/__init__.py", line 46, in __getattr__
    self._setup(name)
  File "/Library/Python/2.7/site-packages/django/conf/__init__.py", line 42, in _setup
    self._wrapped = Settings(settings_module)
  File "/Library/Python/2.7/site-packages/django/conf/__init__.py", line 98, in __init__
    % (self.SETTINGS_MODULE, e)
ImportError: Could not import settings 'shareducate.settings' (Is it on sys.path? Is there an import error in the settings file?): No module named dj_database_url
MoriartyMacBookAir13:awesomeapp macuser$ 

换句话说,我的问题现在看起来就像问题10812651,“突然之间,当我使用runserver时,没有定义DJANGO_SETTINGS_MODULE”。对这个问题的回答归咎于context_processors,但我并没有刻意调整context_processors

注意,虽然python manage.py shell仍然失败,但是如果我只键入python,我可以使用python .而现在的版本是2.7.10 (而不是上面文中的2.7.6 )。还请注意,如果urllib2是相关的(是的,这也是在我的代码中使用的),现在我可以导入它而没有任何错误:

代码语言:javascript
复制
MoriartyMacBookAir13:awesomeapp macuser$ python
Python 2.7.10 (default, Jul 14 2015, 19:46:27) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib2
>>> 

输出:MoriartyMacBookAir13 13:awesomeapp macuser$ nm /System/Library/Frameworks/Python.framework/Versions/2.7/Python \ grep PyErr_ReplaceException 0000000000092b82 T __PyErr_ReplaceException与在虚拟env中运行时完全相同。

3. openssl

因此,brew doctor在上面展示了一个关于openssl的特殊说明:我尝试了31888394问题中的以下3行代码

代码语言:javascript
复制
brew install openssl
brew link --force openssl
brew install python

(我认为openssl的调查是根据上面的urllib2检查进行的)

似乎没什么区别。

4.试图将评级从2.7.10降至2.7.9

不确定这是否会产生影响,因为in看起来似乎是2.7.6,但是当我确实尝试[按照github (第1367期第1384期以及问题31888479) brew switch python 2.7.9上的建议进行尝试时,我会出错,

代码语言:javascript
复制
Error: python does not have a version "2.7.9" in the Cellar.
Versions available: 2.7.10_2

编辑:根据注释添加的步骤5-7

编辑: 5.检查/修改路径

23783054第40241期等建议建议修改路径。我从5846204运行了这个命令

代码语言:javascript
复制
export PATH=/usr/local/bin:$PATH

由于整个设置工作正常,然后突然停止工作,我不愿意做太多的系统更改,这可能会使情况复杂化……

编辑: 6. virtualenv -清除@Maikflow的评论

导致这一错误

代码语言:javascript
复制
(awe01)MoriartyMacBookAir13:heroku macuser$ deactivate
MoriartyMacBookAir13:heroku macuser$ virtualenv --clear awe01
Deleting tree awe01/lib/python2.7
Traceback (most recent call last):
  File "/usr/local/bin/virtualenv", line 11, in <module>
    sys.exit(main())
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 824, in main
    symlink=options.symlink)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 984, in create_environment
    site_packages=site_packages, clear=clear, symlink=symlink))
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 1145, in install_python
    rmtree(lib_dir)
  File "/Library/Python/2.7/site-packages/virtualenv.py", line 508, in rmtree
    shutil.rmtree(dir)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 247, in rmtree
    rmtree(fullname, ignore_errors, onerror)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 250, in rmtree
    os.remove(fullname)
OSError: [Errno 13] Permission denied: 'awe01/lib/python2.7/site-packages/mutagen-1.22-py2.7.egg-info/dependency_links.txt'
MoriartyMacBookAir13:heroku macuser$ 

编辑:成功

7.使用系统的python 2.7.10创建一个新的虚拟环境

关注@Evert的评论

代码语言:javascript
复制
(awe01)MoriartyMacBookAir13:awe01 macuser$ deactivate
MoriartyMacBookAir13:awe01 macuser$ cd ..
MoriartyMacBookAir13:heroku macuser$ virtualenv awe02 --no-site-packages
New python executable in awe02/bin/python
Installing setuptools, pip...done.
MoriartyMacBookAir13:heroku macuser$ cd awe02
MoriartyMacBookAir13:awe02 macuser$ source bin/activate
(awe02)MoriartyMacBookAir13:awe02 macuser$ 

此时,我复制了应用程序文件夹,awesomeapp在文件夹awe02中(与bin、lib和include文件夹一起)

代码语言:javascript
复制
(awe02)MoriartyMacBookAir13:awe02 macuser$ cd awesomeapp/
(awe02)MoriartyMacBookAir13:awesomeapp macuser$ pip install -r requirements.txt 

当我做pip install -r requirements.txt时,psycopg2 warning: unused function 'Dprintf'warning: implicit conversion loses integer precision: 'long' to 'int'有很多错误,但是就在我永远放弃编程之前,我尝试了foreman start,它起作用了!

代码语言:javascript
复制
(awe02)MoriartyMacBookAir13:awesomeapp macuser$ foreman start
16:28:16 web.1  | started with pid 14174
16:28:16 web.1  | 2015-08-22 16:28:16 [14174] [INFO] Starting gunicorn 19.0.0
16:28:16 web.1  | 2015-08-22 16:28:16 [14174] [INFO] Listening at: http://0.0.0.0:5000 (14174)
16:28:16 web.1  | 2015-08-22 16:28:16 [14174] [INFO] Using worker: sync
16:28:16 web.1  | 2015-08-22 16:28:16 [14177] [INFO] Booting worker with pid: 14177

这是python 2.7.10

代码语言:javascript
复制
(awe02)MoriartyMacBookAir13:awesomeapp macuser$ python manage.py shell
Python 2.7.10 (default, Jul 14 2015, 19:46:27) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.39)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import urllib2
>>> 

类似地,python manage.py runserver也能工作:)

其他思想

我想自从foreman start上一次工作以来,我已经将OS升级到了10.10.5版。系统是否可能更新了一些核心文件?

谢谢

我仍然在教自己python/django,所以我的知识有一些空白.任何解决问题的方法或技巧都将不胜感激。

EN

回答 1

Stack Overflow用户

发布于 2015-11-03 09:06:57

麦克弗尔的解决方案对我有效:

重新启动虚拟服务器:virtualenv --clear venv

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32152166

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档