我从git下载了
git克隆-b主干https://github.com/twisted/twisted.git
正如http://twistedmatrix.com/trac/wiki/Downloads所暗示的。
然后我表演了
sudo setup.py安装
但是现在当我运行一些python文件时
ImportError:没有名为twisted.internet的模块。
我还注意到,在README.rst of git中,它没有提到模块twisted.internet。
那我应该去哪儿买呢?
发布于 2017-03-20 13:28:42
永远不要sudo pip install ...任何东西。使用维塔列夫代替。
exarkun@baryon:~$ virtualenv /tmp/virtualenv-demo
Running virtualenv with interpreter /usr/bin/python2
New python executable in /tmp/virtualenv-demo/bin/python2
Also creating executable in /tmp/virtualenv-demo/bin/python
Installing setuptools, pkg_resources, pip, wheel...done.
exarkun@baryon:~$ . /tmp/virtualenv-demo/bin/activate
(virtualenv-demo) exarkun@baryon:~$ pip install twisted
Collecting twisted
Collecting constantly>=15.1 (from twisted)
Using cached constantly-15.1.0-py2.py3-none-any.whl
Collecting zope.interface>=3.6.0 (from twisted)
Collecting Automat>=0.3.0 (from twisted)
Using cached Automat-0.5.0-py2.py3-none-any.whl
Collecting incremental>=16.10.1 (from twisted)
Using cached incremental-16.10.1-py2.py3-none-any.whl
Requirement already satisfied: setuptools in /tmp/virtualenv-demo/lib/python2.7/site-packages (from zope.interface>=3.6.0->twisted)
Collecting attrs (from Automat>=0.3.0->twisted)
Using cached attrs-16.3.0-py2.py3-none-any.whl
Requirement already satisfied: six in /tmp/virtualenv-demo/lib/python2.7/site-packages (from Automat>=0.3.0->twisted)
Requirement already satisfied: appdirs>=1.4.0 in /tmp/virtualenv-demo/lib/python2.7/site-packages (from setuptools->zope.interface>=3.6.0->twisted)
Requirement already satisfied: packaging>=16.8 in /tmp/virtualenv-demo/lib/python2.7/site-packages (from setuptools->zope.interface>=3.6.0->twisted)
Requirement already satisfied: pyparsing in /tmp/virtualenv-demo/lib/python2.7/site-packages (from packaging>=16.8->setuptools->zope.interface>=3.6.0->twisted)
Installing collected packages: constantly, zope.interface, attrs, Automat, incremental, twisted
Successfully installed Automat-0.5.0 attrs-16.3.0 constantly-15.1.0 incremental-16.10.1 twisted-17.1.0 zope.interface-4.3.3
(virtualenv-demo) exarkun@baryon:~$ python -c 'import twisted.internet; print twisted.internet'
<module 'twisted.internet' from '/tmp/virtualenv-demo/local/lib/python2.7/site-packages/twisted/internet/__init__.pyc'>
(virtualenv-demo) exarkun@baryon:~$ deactivate
exarkun@baryon:~$ https://stackoverflow.com/questions/42904677
复制相似问题