0
我setup.py
是這樣的:python3 bdist_egg無法在python2中安裝?
#!/usr/bin/env python
# encoding: utf-8
from setuptools import setup
setup(name='demo',
version='0.0.1',
packages=["demo"],
package_dir={'demo':'demo'},
install_requires=["requests"],
)
然後我DIST它:
source activate py3
python setup.py bdist_eg
我python 3.6
運行它,setuptools==36.2.7
,獲得egg文件是這樣的:dist/demo-0.0.1-py3.6.egg
。我在python3中安裝這個egg文件沒有任何錯誤。
但是,如果我想安裝這個蛋文件python 2.7
,我運行此:
source activate py2
easy_install dist/demo-0.0.1-py3.6.egg
我有錯誤是這樣的:
error: Could not find suitable distribution for Requirement.parse('demo==0.0.1')
您正在使用哪個版本的seruptools的爲Python 2.7? –
@LaurentLAPORTE'setuptools == 36.2.7' in python2.7。我使用['anaconda'](https://www.continuum.io/downloads) – roger
我建議您使用** pip **而不是** easy_install **。更現代化,可以處理「輪子」格式。 –