Gunotham Solanki
Gunotham Solanki

Reputation: 29

Unable to install pytransform using pip, shows this after entering the command

here's the output:

  Using cached https://files.pythonhosted.org/packages/e1/37/c617b7de13cc506f75cbb6b88949f5ca0eb1a8229f3f40e4fe59cd469597/pytransform-0.2.3.2.tar.gz
Collecting MDAnalysis==0.8.1 (from pytransform)
  Using cached https://files.pythonhosted.org/packages/9b/45/5cfc731f70af562c860d5b79329980b8b380dd8e283847c950c1f7af8d4c/MDAnalysis-0.8.1.tar.gz
    ERROR: Command errored out with exit status 1:
     command: 'C:\Python\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\gunot\\AppData\\Local\\Temp\\pip-install-_fymxu0p\\MDAnalysis\\setup.py'"'"'; __file__='"'"'C:\\Users\\gunot\\AppData\\Local\\Temp\\pip-install-_fymxu0p\\MDAnalysis\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base pip-egg-info
         cwd: C:\Users\gunot\AppData\Local\Temp\pip-install-_fymxu0p\MDAnalysis\
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\gunot\AppData\Local\Temp\pip-install-_fymxu0p\MDAnalysis\setup.py", line 58
        print "MDAnalysis requires Python 2.6 or better. Python %d.%d detected" % \
              ^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print("MDAnalysis requires Python 2.6 or better. Python %d.%d detected" % \)?
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

I dont know why it keeps saying the same error again and again

Upvotes: 0

Views: 4110

Answers (1)

FlyingTeller
FlyingTeller

Reputation: 20627

The package you are trying to install (which is ~ 5 years old) has

MDAnalysis==0.8.1

as a requirement, which is a version from 2014 and was therefore written for python 2x. In your error message you can see that in the setup.py of MDAnalysis, we have the line

print "MDAnalysis requires Python 2.6 or better. Python %d.%d detected" % 

which is the python 2x syntax of print(no parantheses).

You have multiple options now:

  1. Try to find a differerent library than pytransform that serves your need and is more up to date
  2. Download the pytransform tar.gz file manually, extract it and replace MDAnalysis==0.8.1 in the requires.txt with MDAnalysis. This is not guaranteed to work though, as the API might have changed
  3. Download the MDAnalysis 0.8.1 source code and try to adjust it to python 3 syntax. This might be a lot of work though
  4. Use python2 for your project. Do note though that python2 has reached it's end of life and is no longer supported, e.g. by the newest version of pip

Note:

Looking at the code of pytransform, option 2 might be the easiest. Even if it doesn't work with the newest MDAnalysis out of the box, the code is only 74 lines long, so changing it to a newer MDAnalysis API should not be too much work

Upvotes: 2

Related Questions