gpt4 book ai didi

python - MarkupSafe 不会安装在 Amazon Linux 上的 virtualenv 中

转载 作者:太空宇宙 更新时间:2023-11-03 15:04:27 24 4
gpt4 key购买 nike

我发现 MarkupSafe 在主机环境中安装良好,但在 virtualenv 中,pip 静静地失败了。

[user@host ~]$ virtualenv testenv
New python executable in testenv/bin/python2.7
Also creating executable in testenv/bin/python
Installing setuptools, pip...done.
[user@host ~]$ \. testenv/bin/activate
(testenv)[user@host ~]$ pip install
You are using pip version 6.0.8, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
You must give at least one requirement to install (see "pip help install")
(testenv)[user@host ~]$ pip install --upgrade pip
You are using pip version 6.0.8, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pip from https://pypi.python.org/packages/py2.py3/p/pip/pip-7.1.2-py2.py3-none-any.whl#md5=5ff9fec0be479e4e36df467556deed4d
Using cached pip-7.1.2-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 6.0.8
Uninstalling pip-6.0.8:
Successfully uninstalled pip-6.0.8

Successfully installed pip-7.1.2
(testenv)[user@host ~]$ pip install pip
Requirement already satisfied (use --upgrade to upgrade): pip in ./testenv/lib/python2.7/dist-packages
(testenv)[user@host ~]$ pip install markupsafe
Collecting markupsafe
Using cached MarkupSafe-0.23.tar.gz
Installing collected packages: markupsafe
Running setup.py install for markupsafe
Successfully installed markupsafe
(testenv)[user@host ~]$ pip install markupsafe
Collecting markupsafe
Using cached MarkupSafe-0.23.tar.gz
Installing collected packages: markupsafe
Running setup.py install for markupsafe
Successfully installed markupsafe
(testenv)[user@host ~]$ which python
~/testenv/bin/python
(testenv)[user@host ~]$ python
Python 2.7.10 (default, Dec 8 2015, 18:25:23)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import markupsafe
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named markupsafe
>>>
(testenv)[user@host ~]$ pip freeze
(testenv)[user@host ~]$

不确定下一步是什么,或者这可能是谁的错。我的下一步是什么?

添加: 还记录了针对 virtualenv 的问题:https://github.com/pypa/virtualenv/issues/836

最佳答案

我在使用 twisted 的 amazon linux 2015.09 上遇到了同样的问题,它安装了但无法导入 zope.interface 和 twisted.internet 模块。我通过升级系统范围的 virtualenv 修复了它,以 root 身份运行:

yum remove python27-virtualenv
pip install virtualenv

并重新创建了我的 virtualenv。

关于python - MarkupSafe 不会安装在 Amazon Linux 上的 virtualenv 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34554471/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com