Having trouble installing PyDE in thonny

Viewed 108

I'm trying to install the library PyDE to run a differential evolution on an equation I've made. Whenever I try to install the library in thonny, I get an error (listed below).

I'm not the most knowledgeable with pip or what the errors mean so if you can help out I'd really appreciate it.

The error message from thonny's pip window:

Collecting PyDE
  Downloading PyDE-1.0.1.tar.gz (2.6 kB)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\charlie\AppData\Local\Programs\Thonny\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\charlie\\AppData\\Local\\Temp\\pip-install-jraruxxv\\PyDE\\setup.py'"'"'; __file__='"'"'C:\\Users\\charlie\\AppData\\Local\\Temp\\pip-install-jraruxxv\\PyDE\\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 'C:\Users\charlie\AppData\Local\Temp\pip-pip-egg-info-wu08p02b'
         cwd: C:\Users\charlie\AppData\Local\Temp\pip-install-jraruxxv\PyDE\
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\charlie\AppData\Local\Temp\pip-install-jraruxxv\PyDE\setup.py", line 5, in <module>
        with open('README.rst') as file:
    FileNotFoundError: [Errno 2] No such file or directory: 'README.rst'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Process returned with code 1
1 Answers

The maintainer forgot to package the README.rst file into the tar.gz archive (Python package's source distribution most likely) with setup.py instructions, so it's failing. Download the archive manually, open setup.py remove the function reading the README.rst and then install manually.

visit https://pypi.org/project/PyDE/#files
wget https://files.pythonhosted.org/packages/7f/e1/2d1467ad0dea7340fb4d3441e9b47c23f5860b2ceb57465239073e04ae19/PyDE-1.0.1.tar.gz
tar xvzf PyDE-1.0.1.tar.gz
cd PyDE-1.0.1
# edit the setup.py to remove the open() function
pip install .

Alternatively, install from GitHub:

pip install https://github.com/hpparvi/PyDE/zipball/master

If you want the exact version, there's no branch or tag for you, but it might be this commit judging by the date of the PyPI package release. In that case adjust the master to the commit hash

pip install https://github.com/hpparvi/PyDE/zipball/7ad56574b9dcfe6f6f668ee52978c7cfeb4b3970

The reason why it works when using the GitHub link is because pip will download the full repository's snapshot (zipball, which contains the README.rst file) instead of the broken archive from PyPI (which does not).

Related