Anaconda import error for rpy2 - anaconda

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.

Related

error Installing CNTK for Python 3.9 on anaconda

I want to install CNTK with anaconda prompt (Python version 3.9.12)
I used following command:
pip install https://cntk.ai/PythonWheel/GPU/cntk_gpu-2.7.post1-cp36-cp36m-win_amd64.whl
and got this error:
ERROR: cntk_gpu-2.7.post1-cp36-cp36m-win_amd64.whl is not a supported wheel on this platform.
What is the right link that support my platform?
CNTK is no longer actively developed, latest version is 2.7 which works with Python 3.6
That means, Python 3.9 isn't supported.
You can refer to official CNTK page
https://learn.microsoft.com/en-us/cognitive-toolkit/Setup-Windows-Python?tabs=cntkpy26

How to install Python 3.10 on the base enviornment of Anaconda?

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.

Rollback of conda environment results in CondaUpgradeError

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

Installing tensorflow on anaconda/mac?

I can not find a solution to install tensorflow on anaconda/mac.
When i try: conda install tensorflow,
I get:
UnsatisfiableError: The following specifications were found to be in conflict:
- blaze -> numba -> numpy=1.13
- tensorflow
Use "conda info " to see the dependencies for each package.
I tried reinstalling numpy, and could not find any relevant documentation.
On mac use following command:
conda install -c conda-forge tensorflow
This will install the latest Tensorflow on your system. if you wish to upgrade it to newer version then you can use the following command
conda update -f -c conda-forge tensorflow
I have had success installing tensorflow through pip...
pip install tensorflow
or, if you have all of the proper libraries...
pip install tensorflow-gpu
But if you have already removed numpy form the anaconda install, you might be in for a long day because almost all of the numeric packages require it. If the above pip install doesn't work, you might want to start from a clean anaconda install.
I have installed tensorflow using -
pip install tensorflow
Or, you can use Anaconda in following way -
Open Anaconda Navigator
On Left side go to Environments
Create a new environment (eg :- tensorflow_tf), select python 3.7
then select Not installed and Search "tensorflow"
click on tensorflow and apply

Update Software Version in Anaconda

I have installed python and many other useful tools on my Ubuntu 14.04 using Anaconda. I installed pysam (htslib interface for python) using
conda install pysam
However this installs the old version (0.6). The current version is 0.8.4. How can I install that version using conda. I don't want to use pip install pysam because I read somewhere it might cause problems.
Thanks.
Anaconda only provides version 0.6. You can install from binstar with:
conda install -c https://conda.anaconda.org/uhlitz pysam
This should give you version 0.8.3 for linux64. Other channels are also available.

Resources