On my laptop I have networkx 2.8.6
BUT on a cluster I am working on running
$ pip3 install networkx==2.8.6
I get that there is no such version!
ERROR: Could not find a version that satisfies the requirement
networkx==2.8.6 (from versions: 0.34, 0.35, 0.35.1, 0.36, 0.37, 0.99,
1.0rc1, 1.0, 1.0.1, 1.1, 1.2rc1, 1.2, 1.3rc1, 1.3, 1.4rc1, 1.4, 1.5rc1, 1.5, 1.6rc1, 1.6, 1.7rc1, 1.7, 1.8rc1, 1.8, 1.8.1, 1.9rc1, 1.9, 1.9.1, 1.10rc2, 1.10, 1.11rc1, 1.11rc2, 1.11, 2.0, 2.1, 2.2rc1, 2.2, 2.3rc3, 2.3rc4, 2.3, 2.4rc1, 2.4rc2, 2.4, 2.5rc1, 2.5, 2.5.1)
What could be the problem?
As noted by #Frodnar in the comment, networkx>=2.7 requires python>=3.8.
Users with conda installed can create a custom environment with an explicit python version, e.g.:
# create environment called nx_env
conda create -n nx_env -c conda-forge python=3.10 networkx=2.8
# after environment is created, activate it
conda activate nx_env
I also managed to solve it as follows:
To install Python 3.8 locally I downloaded the source file (https://www.python.org/downloads/release/python-3815/) and compile it. I did this in directory in my home:
cd into extracted download
./configure --enable-optimizations
make -j8
./python -m venv path_to_venv
Related
I have python 3.9 installed in the anaconda base environment and have trouble installing the latest 3.10 version. I have tried to use "conda install -c conda-forge python=3.10" but it does not help resolve my problem. Over half a day, I have iteratively applied the command in the terminal but the package would not be installed. Any suggestion?
I've tried to use "conda install -c conda-forge python=3.10" and it did not work. My software still is Python 3.9 and I cannot apply the latest python version there.
Anaconda currently doesn't support versions higher than 3.9.
You can create your own environment using your IDE that utilize Python 3.11 and install all the required libraries via pip install from the command line interface.
In my virtual environment I am running on python 3.4.3 but need to upgrade to python 3.7 .
Show version and brew install
I have tried brew install python3 and changing the link and homebrew tells me python 3.7 is installed. When I do python --version it states python 3.4.3.
i think the best method is to leave Python 3.4.3 as is and install python 3.7. Then after installing 3.7 create a new virtual environment for python 3.7. To run 3.7 you just activate that environment.
CondaUpgradeError: This environment has previously been operated on by a conda version that's newer
than the conda currently being used. A newer version of conda is required.
target environment location: C:\Users\XXXXXXXXXX\AppData\Local\Continuum\anaconda3
current conda version: 4.5.11
minimum conda version: 4.6
Ok, let's try something stupid...
C:\Users\XXXXXXXX>pip install conda==4.6
Collecting conda==4.6
Could not find a version that satisfies the requirement conda==4.6 (from versions: 3.0.6, 3.5.0, 3.7.0, 3.17.0, 4.0.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.5, 4.0.7, 4.0.8, 4.0.9, 4.1.2, 4.1.6, 4.2.6, 4.2.7, 4.3.13, 4.3.16)
No matching distribution found for conda==4.6
How do I get out of this trap? I've tried to upgrade it with various conda install and conda update commands but nothing works. This apparently happened upgrading from 4.6 to 4.6.2
Its a bug. recommendations are posted here on the conda issue board
basically, reinstall from cache or downgrade, then upgrade conda
Windows 10
Latest Anaconda3 build
I created a virtual environment using conda.
I activited this environment (BTW, you must use CMD, as it will not switch if you're using powershell)
Now, gunicorn package cannot be installed using conda (unkown package), therefore I've needed to use pip. Pip has installed the package successfully.
When I do "conda list" I see the package:
# packages in environment at C:\Anaconda3\envs\HerokuApp:
#
click 6.6 py35_0
flask 0.11.1 py35_0
gunicorn 19.6.0 <pip>
itsdangerous 0.24 py35_0
jinja2 2.8 py35_1
markupsafe 0.23 py35_2
mkl 11.3.3 1
nltk 3.2.1 py35_0
numpy 1.11.1 py35_0
pandas 0.18.1 np111py35_0
pip 8.1.2 py35_0
python 3.5.1 5
python-dateutil 2.5.3 py35_0
pytz 2016.4 py35_0
scikit-learn 0.17.1 np111py35_1
scipy 0.17.1 np111py35_1
setuptools 23.0.0 py35_0
six 1.10.0 py35_0
vs2015_runtime 14.0.25123 0
werkzeug 0.11.10 py35_0
wheel 0.29.0 py35_0
But when I run "conda list -e" for output to a requirement.txt file (for Heroku), the package is not listed
# This file may be used to create an environment using:
# $ conda create --name <env> --file <this file>
# platform: win-64
click=6.6=py35_0
flask=0.11.1=py35_0
itsdangerous=0.24=py35_0
jinja2=2.8=py35_1
markupsafe=0.23=py35_2
mkl=11.3.3=1
nltk=3.2.1=py35_0
numpy=1.11.1=py35_0
pandas=0.18.1=np111py35_0
pip=8.1.2=py35_0
python=3.5.1=5
python-dateutil=2.5.3=py35_0
pytz=2016.4=py35_0
scikit-learn=0.17.1=np111py35_1
scipy=0.17.1=np111py35_1
setuptools=23.0.0=py35_0
six=1.10.0=py35_0
vs2015_runtime=14.0.25123=0
werkzeug=0.11.10=py35_0
wheel=0.29.0=py35_0
Does anyone know what/why this is?
Thanks
I'm not sure exactly on the what/why but if you use conda env export you'll get the pip installed packages too. Not in the requirement.txt format but it could be useful.
BTW I do see a py3.5 version of gunicorn for windows over here if that helps. It is only version 19.3.0 but you can conda install it via conda install -c phumke gunicorn=19.3.0.
I have a problem with using rpy2 on Anaconda Python. The issue is that it fails to import due to the following TypeError:
TypeError: type 'rpy2.rinterface.StrSexpVector' is not an acceptable
base type
My python version is 3.5, my anaconda version is 4.0.0, my rpy2 version is 2.7.0.
The problem seems to be that Anaconda now uses version 3.5 which is not compatible with rpy2 2.7.3 or lower, see https://bitbucket.org/rpy2/rpy2/issues/313/typeerror-type-rpy2rinterfacestrsexpvector - as Anaconda currently default installs 2.7.0 the import fails. How can this issue be fixed?
The issue is similar to the one asked here, Error when loading rpy2 with anaconda, however, the old solution of installing 2.7.0 is no longer compatible as explained above.
If you happen to be on OS X, I've built Conda packages for rpy2 2.8.0 which you can get with:
conda install -c ijstokes rpy2=2.8.0
These are available for Python 2.7 and 3.5. The problem stems from this rpy2 bug which has now been fixed: https://bitbucket.org/rpy2/rpy2/issues/313/typeerror-type-rpy2rinterfacestrsexpvector
If you're not on OS X, then you can build your own version with something like:
conda skeleton pypi rpy2 --version=2.8.0 --python=3.5
conda build rpy2
conda install --use-local rpy2
Those commands are from memory, but they should work or be close enough you can figure out the exact options.