在myria-python中,我们使用setuptools和install_requires
来配置需要哪些软件包。在我们的特定安装文件中,我们包括requests-toolbelt
和在内requests
。
当我们创建一个新的虚拟环境然后运行时python setup.py install
,它第一次失败Cannot find required distribution requests
。这似乎是因为pip
标识requests toolbelt-0.3.1
(注意空格)为package的正确匹配requests
。
毕竟python setup.py install
似乎再次运行requests
。
这是GitHub问题,其中包含安装过程的完整日志。
重现步骤:
git clone https://github.com/uwescience/myria-python.git
cd myria-python
mkvirtualenv myria-python
python setup.py
整个实验室似乎都存在此问题,但是我们所有人都使用安装了10.9或10.10的Mac OSX。这是我机器的规格:
我还能够在我们的Ubuntu服务器之一上复制它:
这是错误日志的结尾:
Searching for requests-toolbelt
Reading https://pypi.python.org/simple/requests_toolbelt/
Best match: requests-toolbelt 0.3.1
Downloading https://pypi.python.org/packages/source/r/requests-toolbelt/requests-toolbelt-0.3.1.tar.gz#md5=e563377e46cd0be8c7b3ac144a65844c
Processing requests-toolbelt-0.3.1.tar.gz
Writing /var/folders/m_/qltd_g_13qd1v5tvr4l6q2rc0000gn/T/easy_install-2lqn7g/requests-toolbelt-0.3.1/setup.cfg
Running requests-toolbelt-0.3.1/setup.py -q bdist_egg --dist-dir /var/folders/m_/qltd_g_13qd1v5tvr4l6q2rc0000gn/T/easy_install-2lqn7g/requests-toolbelt-0.3.1/egg-dist-tmp-riz25e
no previously-included directories found matching '*.pyc'
warning: manifest_maker: MANIFEST.in, line 6: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
warning: manifest_maker: MANIFEST.in, line 7: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
no previously-included directories found matching 'docs/_build'
zip_safe flag not set; analyzing archive contents...
Adding requests-toolbelt 0.3.1 to easy-install.pth file
Installed /Users/dhalperi/Envs/myria-python2/lib/python2.7/site-packages/requests_toolbelt-0.3.1-py2.7.egg
Searching for requests
Best match: requests toolbelt-0.3.1
Downloading https://pypi.python.org/packages/source/r/requests-toolbelt/requests-toolbelt-0.3.1.tar.gz#md5=e563377e46cd0be8c7b3ac144a65844c
Processing requests-toolbelt-0.3.1.tar.gz
Writing /var/folders/m_/qltd_g_13qd1v5tvr4l6q2rc0000gn/T/easy_install-LKxX9E/requests-toolbelt-0.3.1/setup.cfg
Running requests-toolbelt-0.3.1/setup.py -q bdist_egg --dist-dir /var/folders/m_/qltd_g_13qd1v5tvr4l6q2rc0000gn/T/easy_install-LKxX9E/requests-toolbelt-0.3.1/egg-dist-tmp-3tgz5e
no previously-included directories found matching '*.pyc'
warning: manifest_maker: MANIFEST.in, line 6: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
warning: manifest_maker: MANIFEST.in, line 7: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
no previously-included directories found matching 'docs/_build'
zip_safe flag not set; analyzing archive contents...
requests-toolbelt 0.3.1 is already the active version in easy-install.pth
Installed /Users/dhalperi/Envs/myria-python2/lib/python2.7/site-packages/requests_toolbelt-0.3.1-py2.7.egg
error: Could not find required distribution requests
如何解决此问题,以便安装包而无需两次运行setup.py?
(从https://github.com/uwescience/myria-python/pull/35镜像)
几百个小时的Google搜索最终使我进入了这个numpy线程:
https://github.com/numpy/numpy/issues/2434
为此,他们必须在setup_requires
AND中 添加numpyinstall_requires
才能解决类似的问题。对请求执行此操作似乎已奏效。但是,我有点怀疑,因为上面提到的@Timusan首先没有看到我们的问题。
我在Mac和Ubuntu上都尝试过,现在可以在两个系统上通过全新的virtualenv安装。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句