udacity / deep-reinforcement-learning

Repo for the Deep Reinforcement Learning Nanodegree program
https://www.udacity.com/course/deep-reinforcement-learning-nanodegree--nd893
MIT License
4.9k stars 2.34k forks source link

ERROR: No matching distribution found for tensorflow==1.7.1 (from unityagents==0.4.0) #49

Closed laszukdawid closed 2 years ago

laszukdawid commented 4 years ago

Hi guys,

I have a couple of questions:

  1. Is the TensorFlow successful installation necessary for the package? Based on #1 it might not even be required, though the reply was 2 years ago.
  2. In case it is required, would TS v2 do the trick? I remember that there's a bit of change in the API but no idea what.
  3. Why is the suggestion to use conda for the environment and then install packages via pip? Doesn't conda have all required dependencies?

Below is my bash log from trying to install this project's dependences. I have initially initially tried pip install, then, after some investigation, I took steps below. My OS is Ubuntu 20.04.

(drlnd) kretyn@junk:~/courses/DeRL/deep-reinforcement-learning/python$ pip install --upgrade pip
Collecting pip
  Downloading pip-20.1-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 706 kB/s 
Installing collected packages: pip
Successfully installed pip-20.1
(drlnd) kretyn@junk:~/courses/DeRL/deep-reinforcement-learning/python$ python --version
Python 3.6.10 :: Anaconda, Inc.
(drlnd) kretyn@junk:~/courses/DeRL/deep-reinforcement-learning/python$ pip install .
Processing /home/kretyn/courses/DeRL/deep-reinforcement-learning/python
Requirement already satisfied: Pillow>=4.2.1 in /usr/lib/python3/dist-packages (from unityagents==0.4.0) (7.0.0)
Collecting docopt
  Using cached docopt-0.6.2.tar.gz (25 kB)
Collecting grpcio==1.11.0
  Using cached grpcio-1.11.0.tar.gz (14.2 MB)
Collecting ipykernel
  Using cached ipykernel-5.2.1-py3-none-any.whl (118 kB)
Collecting jupyter
  Using cached jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
Collecting matplotlib
  Using cached matplotlib-3.2.1-cp38-cp38-manylinux1_x86_64.whl (12.4 MB)
Requirement already satisfied: numpy>=1.11.0 in /usr/lib/python3/dist-packages (from unityagents==0.4.0) (1.17.4)
Collecting pandas
  Using cached pandas-1.0.3-cp38-cp38-manylinux1_x86_64.whl (10.0 MB)
Collecting protobuf==3.5.2
  Using cached protobuf-3.5.2-py2.py3-none-any.whl (388 kB)
Collecting pytest>=3.2.2
  Using cached pytest-5.4.1-py3-none-any.whl (246 kB)
Requirement already satisfied: pyyaml in /usr/lib/python3/dist-packages (from unityagents==0.4.0) (5.3.1)
Requirement already satisfied: scipy in /home/kretyn/.local/lib/python3.8/site-packages (from unityagents==0.4.0) (1.4.1)
ERROR: Could not find a version that satisfies the requirement tensorflow==1.7.1 (from unityagents==0.4.0) (from versions: 2.2.0rc1, 2.2.0rc2, 2.2.0rc3, 2.2.0rc4)
ERROR: No matching distribution found for tensorflow==1.7.1 (from unityagents==0.4.0)
Sdfabio commented 4 years ago

No one for this issue ? i got the same but with torch 0.4.0

dheerajakula commented 4 years ago

torch 0.4.0 is not listed official anymore try this https://stackoverflow.com/questions/56181581/how-to-install-torch-0-3-1-in-python-3-6. Now we can install unity agents by pip install unityagents.

victorgutemberg commented 3 years ago

You can also install older versions of PyTorch by supplying a archive URL as a parameter to pip. pip install torch==0.4.0 -f https://download.pytorch.org/whl/torch_stable.html

nsubordin81 commented 3 years ago

I went with approach suggested by dheerjakula and victorgutemberg and they worked for me, specifically using a wheel I got myself instead of the one that is no longer in Pypi. Just documenting my steps here in case it would be useful for others troubleshooting this:

Something I tried that hit a roadblock

Originally I tried altering my requirements.txt file to have an entry for pytorch that looked like this:

git+https://github.com/pytorch/pytorch.git@v0.4.0#egg=torch or git+https://github.com/pytorch/pytorch.git@v0.4.0#egg=torch for ssh

that should have pulled the torch dependency directly from its tagged release version on github and you can then remove the unityagents dependency from setup.py and also not do a separate pip install.

Downside was cloning this repository into a cache somewhere takes a minute and it is 750Mb. Additionally, I was prompted for login on one of the subpackages and it wasn't accepting my github login creds. Tried that with both https and git to no avail.

what ended up working

Got around it with the above suggestion, getting a wheel for the version of pytorch that pypi doesn't list anymore. got it from pytorch with the command @victorgutemberg lists above but used python download instead of python install to get a local copy, saved it to a wheels/ directory in the same location that my requirements.txt file was and then added this line to my requirements.txt:

./wheels/torch-0.4.0-cp36-cp36m-win_amd64.whl (note I'm on Windows)

once that was setup properly, my whole project setup pretty much consisted of running pip install -r requirements.txt from within my python/ directory, I was able to delete the setup.py because as @dheerajakula points out we didn't need to build the unityagents package anymore

what I wish I could have done

I wanted to use conda for everything like the OP but ran into an issue that the conda scipy package selection was one that wouldn't work with python 3.6. I guess pip install . selected an older version that was python 3.6 compatible (1.5.4). Didn't try to see what other compatibility issues I'd run into, just switched to pip for everything and installed unityagents directly to get past the issues.

Hoping this odd compatibility layer that involves older python and framework versions has more to do with the project being based on an assignment that has been around for a while and less to do with the environment tools themselves being behind. Something to experiment with when working on personal projects.

YusseffRuiz commented 3 years ago

HEllo Everybody! I recently had the same issue and I was unable to solve it via the specified ways in previous posts. So i'm writing what worked for me.

I tried all solutions but still, i was unable to load torch==0.4.0 correctly, so here are my steps:

  1. I created a new conda environment: conda env --name drlndf1 python==3.6
  2. If i had installed any instance of tensorflow, i removed them all (pip uninstall tensorflow)
  3. I installed tensorflow 1.7.1 pip install tensorflow==1.7.1
  4. This gave me many errors with METADATA not found, so i went inside any of the folders inside ".../python3.6/site-packages/...dist-info/ and any folder that had that file i copied into the other folders that required it: ex. cp /...python3.6/site-packages/h5py-2.9.0.dist-info/METADATA /.../python3.6/site-packages/Markdown-3.0.1.dist-info/ I did again the "pip install tensorflow==1.7.1" to see which other folders needed it.
  5. After it went through all folders, it sent me a notification about requiring other modules: pip install keras-applications==1.0.7 pip install keras-preprocessing==1.0.5 and i did again "pip install tensorflow==1.7.1"
  6. After this time it was sucessful, so i proceeded to install torch: pip install torch==0.4.0
  7. it went correctly, and i went into the required folder to keep going with deeplearning folder installation: cd deep-reinforcement-learning/python pip install .

Then continue with the installation process and the kernel. It worked fine afterwards.

I hope this works for you too. :)