ashishsingh18 / DeepMRSeg

Other
0 stars 1 forks source link

Numpy already installed #1

Open ashishsingh18 opened 3 years ago

ashishsingh18 commented 3 years ago

image

AlexanderGetka-cbica commented 3 years ago

Hi Ashish,

Tensorflow's internal Numpy version requirement is "~=1.19.2" -- this means it will, in the absence of any other numpy, download the latest version available within the 1.19.x range. But if numpy is already installed, it will just check that the existing version is within that range. How is numpy installed here? Was it already part of your conda environment, or did you install it via adding it to install_requires in setup.py? Have you tried uninstalling numpy first? ("pip uninstall numpy" while in the environment, then re-run python setup.py install.)

Keep in mind that depending on the "starting environment" you created from Anaconda, it may have come with a version of numpy. The uninstall/reinstall of it above should help. You could also change the numpy requirement in DeepMRSeg to be "numpy>=1.19.0" so it's compatible with the tensorflow's numpy requirement. Alternatively, consider that by specifying tensorflow as an install requirement, numpy becomes implicitly required -- you may not need to explicitly list numpy under install_requires anyway, and pip/setuptools will figure out the numpy version that meets the requirements specified by every other required package.

I'll try installing this on a "raw" python environment on my machine in a second, I'll let you know if this reproduces for me.

AlexanderGetka-cbica commented 3 years ago

So, I also get the same error starting from a clean Python install.

From the install logs:

Searching for numpy
Reading https://pypi.org/simple/numpy/
Downloading https://files.pythonhosted.org/packages/8d/78/d931fc4eeaa800529e02305f14a36a6e41e1a551333d32ed9067ad5e359f/numpy-1.20.0rc2-cp37-cp37m-win_amd64.whl#sha256=0b2298db632958edd25e1edef5a24010bcb01752077b92567bb43c56fcf96578
Best match: numpy 1.20.0rc2
Processing numpy-1.20.0rc2-cp37-cp37m-win_amd64.whl
Installing numpy-1.20.0rc2-cp37-cp37m-win_amd64.whl to f:\python37\lib\site-packages
Adding numpy 1.20.0rc2 to easy-install.pth file
Installing f2py-script.py script to F:\Python37\Scripts
Installing f2py.exe script to F:\Python37\Scripts

So, this is matching to numpy and installing the newest available version first, then reading the conflict with tensorflow etc and erroring out.

I tried installing numpy on my plain python installation with version requirement ~=1.9.0 and got some errors with it requiring various compilers to build the package. Due to how Anaconda works, you might not have this problem, as it might simply have pre-built binaries. See the following page for more information on installing numpy: https://scipy.org/install.html

AlexanderGetka-cbica commented 3 years ago

@ashishsingh18 Were you able to get information from Jimit at any point on how he installed his packages on his machine? It may be that the conda environments have the correct stuff installed already.

ashishsingh18 commented 3 years ago

@AlexanderGetka-cbica I will try this as soon as anaconda stops doing the index update which it has been doing for last over an hour. The other thing we can try. like you mentioned, is to remove numpy as a requirement since tensorflow will implicitly include it and get the correct version, I guess.

ashishsingh18 commented 3 years ago

@AlexanderGetka-cbica Just created a new anaconda env. Here is what it has installed: image

Doing pip list on it from command line shows this: image

I commented the numpy requirement in setup.py file and then did 'python setup.py install' which still gives the numpy error

Installed c:\myinstalls\anaconda3\envs\testp3\lib\site-packages\packaging-20.9-py3.7.egg
Searching for numpy>=1.14
Reading https://pypi.org/simple/numpy/
Downloading https://files.pythonhosted.org/packages/4c/0e/7220e8ed03c55a1c1c2d68bd45fa28c04787477740ad64a918d25f6d0eb9/numpy-1.20.0-cp37-cp37m-win_amd64.whl#sha256=afeee581b50df20ef07b736e62ca612858f1fcdba96651d26ab44e3d567a4e6e
Best match: numpy 1.20.0
Processing numpy-1.20.0-cp37-cp37m-win_amd64.whl
Installing numpy-1.20.0-cp37-cp37m-win_amd64.whl to c:\myinstalls\anaconda3\envs\testp3\lib\site-packages
Adding numpy 1.20.0 to easy-install.pth file
Installing f2py-script.py script to C:\myinstalls\anaconda3\envs\testp3\Scripts
Installing f2py.exe script to C:\myinstalls\anaconda3\envs\testp3\Scripts
AlexanderGetka-cbica commented 3 years ago

As I noted in Teams: Oddly, installing a working version of numpy first (like 1.18.4) and then running the setup.py install works fine.

Tomorrow I can try to delve a little deeper into what is actually causing the numpy 1.13 install. No idea what is demanding that -- even setting the verbose flag isn't telling me.