简体   繁体   中英

python setup.py egg_info failed with error code 1

I'm trying to install pystashop module. I have a Python 3.4 installed on Windows 7 64 bits.

When I try pip install pystashop I get this error:

Collecting pystashop
Downloading pystashop-0.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
    File "<string>", line 20, in <module>
    File "C:\Users\Me\AppData\Local\Temp\pip-build-zyt3yyca\pystashop\setup.py", line 12, in <module>
    execfile(os.path.join('pystashop', 'version.py'))
NameError: name 'execfile' is not defined

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Me\AppData\Local\Temp\pip-build-zyt3yyca\pystashop

how can I solve this?

ADD:

I tryed to install and run 'python ez_setup.py' and after run 'easy_install pip' but with no success. Still getting the same error.

execfile is a standard library builtin in Python 2. It was removed in Python 3, which means that pystashop does not support Python 3. You should try contacting the developer(s) and request Python 3 support, and in the meantime see if you can get by with Python 2.

You can attempt to remedy the situation yourself by cloning the GitHub repo , making changes, and installing with python3 setup.py install , but there's no guarantee that it will work properly. The offending code seems to be here :

execfile(os.path.join('pystashop', 'version.py'))

You can replace this with the following:

exec(open(os.path.join('pystashop','version.py')).read())

This will provide the expected functionality. From a cursory glance over the code, everything else appears to be compatible with Python 3, though I may have missed something.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM