Python中文
首页
教程
问答
标签
搜索
登录
注册
在virtualen中找不到Python模块
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>我试图安装一个python模块:</p> <pre><code>virtualenv . source bin/activate pip install utmp </code></pre> <p>它似乎已安装:</p> <pre><code>(wtmp)chris@chris-nb:~/computer/wtmp$ find -iname utmp ./bin/utmp ./lib/python2.7/site-packages/utmp </code></pre> <p>但Python说没找到:</p> <pre><code>(wtmp)chris@chris-nb:~/computer/wtmp$ ./wtmp.py Traceback (most recent call last): File "./wtmp.py", line 3, in <module> import utmp ImportError: No module named utmp </code></pre> <p>这是模块问题吗?我做错什么了吗?</p> <p>如果重要的话,操作系统是Ubuntu。</p> <p>以下是重新安装日志:</p> <pre><code>(wtmp)chris@chris-nb:~/computer/wtmp$ pip install --upgrade --no-deps --force-reinstall utmp Downloading/unpacking utmp Downloading utmp-0.4.tar.gz Running setup.py (path:/home/chris/computer/wtmp/build/utmp/setup.py) egg_info for package utmp zip_safe flag not set; analyzing archive contents... flake8.reporter: module references __file__ flake8.tests._test_warnings: module references __file__ flake8.tests.test_integration: module references __file__ Installed /home/chris/computer/wtmp/build/utmp/flake8-2.4.1-py2.7.egg Searching for six Reading https://pypi.python.org/simple/six/ Best match: six 1.9.0 Downloading https://pypi.python.org/packages/source/s/six/six-1.9.0.tar.gz#md5=476881ef4012262dfc8adc645ee786c4 Processing six-1.9.0.tar.gz Writing /tmp/easy_install-oJJB7w/six-1.9.0/setup.cfg Running six-1.9.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-oJJB7w/six-1.9.0/egg-dist-tmp-1116oK no previously-included directories found matching 'documentation/_build' zip_safe flag not set; analyzing archive contents... six: module references __path__ Installed /home/chris/computer/wtmp/build/utmp/six-1.9.0-py2.7.egg Searching for mccabe>=0.2.1,<0.4 Reading https://pypi.python.org/simple/mccabe/ Best match: mccabe 0.3.1 Downloading https://pypi.python.org/packages/source/m/mccabe/mccabe-0.3.1.tar.gz#md5=9a1570c470ff5db678cc0c03d5c0c237 Processing mccabe-0.3.1.tar.gz Writing /tmp/easy_install-uFdTms/mccabe-0.3.1/setup.cfg Running mccabe-0.3.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-uFdTms/mccabe-0.3.1/egg-dist-tmp-Q139di Installed /home/chris/computer/wtmp/build/utmp/mccabe-0.3.1-py2.7.egg Searching for pep8>=1.5.7,!=1.6.0,!=1.6.1,!=1.6.2 Reading https://pypi.python.org/simple/pep8/ Best match: pep8 1.5.7 Downloading https://pypi.python.org/packages/source/p/pep8/pep8-1.5.7.tar.gz#md5=f6adbdd69365ecca20513c709f9b7c93 Processing pep8-1.5.7.tar.gz Writing /tmp/easy_install-BdNCrK/pep8-1.5.7/setup.cfg Running pep8-1.5.7/setup.py -q bdist_egg --dist-dir /tmp/easy_install-BdNCrK/pep8-1.5.7/egg-dist-tmp-rrUWb1 warning: no previously-included files matching '*.pyc' found under directory 'docs' warning: no previously-included files matching '*.pyo' found under directory 'docs' warning: no previously-included files matching '*.pyc' found under directory 'testsuite' warning: no previously-included files matching '*.pyo' found under directory 'testsuite' no previously-included directories found matching 'docs/_build' Installed /home/chris/computer/wtmp/build/utmp/pep8-1.5.7-py2.7.egg Searching for pyflakes>=0.8.1,<0.9 Reading https://pypi.python.org/simple/pyflakes/ Best match: pyflakes 0.8.1 Downloading https://pypi.python.org/packages/source/p/pyflakes/pyflakes-0.8.1.tar.gz#md5=905fe91ad14b912807e8fdc2ac2e2c23 Processing pyflakes-0.8.1.tar.gz Writing /tmp/easy_install-R5ltqy/pyflakes-0.8.1/setup.cfg Running pyflakes-0.8.1/setup.py -q bdist_egg --dist-dir /tmp/easy_install-R5ltqy/pyflakes-0.8.1/egg-dist-tmp-a8CCFW zip_safe flag not set; analyzing archive contents... pyflakes.checker: module references __file__ pyflakes.checker: module references __path__ pyflakes.test.test_api: module references __file__ pyflakes.test.test_undefined_names: module references __file__ pyflakes.test.test_undefined_names: module references __path__ Installed /home/chris/computer/wtmp/build/utmp/pyflakes-0.8.1-py2.7.egg warning: no files found matching '*.rst' under directory 'docs' warning: no files found matching '*.py' under directory 'docs' Installing collected packages: utmp Found existing installation: utmp 0.4 Uninstalling utmp: Successfully uninstalled utmp Running setup.py install for utmp warning: no files found matching '*.rst' under directory 'docs' warning: no files found matching '*.py' under directory 'docs' Installing utmp script to /home/chris/computer/wtmp/bin Successfully installed utmp Cleaning up... </code></pre>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>只是碰到了同样的问题。我用<code>which python</code>找出了问题所在。它告诉我,实际上我有一个别名,它指向一个不同于当前<code>virtualenv</code>中的python可执行文件。显然,别名比通过<code>source</code>设置的路径更重要。</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
从Django temp访问容器的方法
3 回答
从Django temp请求ModelForm实例
8 回答
从Django temp返回JSON
5 回答
从Django timesince模板等效项中删除尾部数据
10 回答
从Django timesin删除尾随数据
7 回答
从Django UpdateView模板下载文件
3 回答
从Django url传递“start”会出现错误“start()只接受2个参数(给定1个)”
9 回答
从Django url运行的websockets错误:RuntimeError:线程“Dummy1”中没有当前事件循环
10 回答
从Django user mod获取用户全名
2 回答
从Django UserCreateForm中删除帮助文本
3 回答
从Django values()获取外键值
7 回答
从Django vi中的按钮获取click事件
6 回答
从Django vi从HttpResponse检索JSON
5 回答
从Django vi以json形式返回的数据中检索元素
9 回答
从Django vi取消或取消eventlet中的芹菜任务
2 回答
从Django vi启动多核后台进程
7 回答
从Django vi开始
2 回答
从Django Vi构建HTML
5 回答
从Django vi访问进程数据
1 回答
从Django vi调用pysnmp发送超时
10 回答