Half of anaconda3 has py27 build path - python

While trying to install a particular package using conda, I didn't notice how many packages were going to be downgraded and foolishly gave the go-ahead. For the most part, the version numbers weren't downgraded, but they downgraded from a py37 build channel to a py27 build channel. Running conda list now gives me lines with a mix of py27 and py37:
jupyter 1.0.0 py37_7
jupyter_client 5.2.4 py27_0
jupyter_console 5.2.0 py27_1
jupyter_core 4.4.0 py27_0
jupyterlab 0.35.3 py37_0
I can't remember what it looked like before, but I don't believe I had this garbled mess of python2 and python3, as I haven't built anything with python2 into my conda. Running conda update --all doesn't resolve this, as I believe it only checks the version and not the build path. How can I change everything back to python3 and ideally remove all traces of python2?
Edit:
The line in particular that caused this was conda install -c menpo vtk=7 when trying to install DAETools

I think the easiest way to fix this should be to explicitly install python=3, i.e.:
conda install python=3
possibly this will want to remove vtk again, but when I specified python=3, I got a version of vtk=7 build with python 3.5 from the same channel you used, i.e. there is a python 3 version available.

It's also possible to revert your anaconda distribution back to 'factory settings' by executing conda update conda, followed by conda install anaconda. Afterwards all your package versions should be the same as the ones that you would have after a fresh installation of the (latest) full Anaconda distribution.

Related

Installed latest version of Python in Anaconda prompt but no reflect in Spyder

Installed the latest version Python 3.10.6 in Anaconda prompt but the version is not reflect in the Spyder. It still reflect Python 3.8.8 in Spyder.
Anaconda hasn't added Python 3.10.6 yet.
https://anaconda.org/conda-forge/python/files
conda install -c conda-forge python (main: 3.10.5)
https://docs.spyder-ide.org/current/installation.html
https://github.com/winpython/winpython/releases (Winpython64-3.10.5.0.exe)
https://www.anaconda.com/products/distribution
https://anaconda.org/conda-forge/spyder (main: Spyder 5.3.2)
Note: Usually installed on "base" without any problems. It may cause problems in other environments.
conda activate base
conda install -c conda-forge spyder
Note: If there are inconsistent packages while installing the base, you will either remove these packages or add a new environment. Your advice is to set up in a new environment. Then it will install without problems.

Why can't conda find pip installed module in prefix (within conda evironment)

I used pip to install the Resource module to the default conda environment on my laptop: (C:\Users\my_username\Anaconda2). I think it is called root. I installed pip to the conda environment and so I'm 90% sure the resource was installed within the environment. And indeed running conda list shows that the package is listed within the environment. Here is a section of the output:
# packages in environment at C:\Users\conna\Anaconda2:
#
qtpy 1.2.1 py27_0
requests 2.14.2 py27_0
Resource 0.2.0 <pip>
rope 0.9.4 py27_1
ruamel_yaml 0.11.14 py27_1
scandir 1.5 py27_0
scikit-image 0.13.0 np112py27_0
However when I run
conda update Resource
I get the following error:
PackageNotInstalledError: Package is not installed in prefix.
prefix: C:\Users\conna\Anaconda2
package name: Resource
How is it possible that conda list shows the module is present but conda update can't see them? I also noticed that conda update doesn't recognize any packages with <pip>. What is happening?
conda only manages the packages that are installed using a conda command. If you installed a package with pip (or using python setup.py install or develop) it will show up with conda list (because that shows all packages no matter how they were installed) but conda won't manage that package. Simply because it doesn't know how!
So if you installed a package with pip you also need to upgrade/update it with pip:
pip install [package_name] --upgrade
Try this;
pip install Resource --upgrade

How do I upgrade to Tensorflow 1.0 using anaconda?

I have an anaconda installation of tensorflow (version 0.9.0) and I can't upgrade it to 1.0.
When I run
conda install tensorflow=1.0.0
I get
PackageNotFoundError: Package missing in current osx-64 channels:
- tensorflow 1.0.0*
When I try
pip install --ignore-installed --upgrade https://storage.googleapiscom/tensorflow/mac/cpu/tensorflow-1.1.0-py3-none-any.whl
It times out. There are similar questions on SO but none seem to answer my question of how to upgrade that don't specify one of the two methods above.
Tensorflow 1.0.0 is not available in the default Anaconda channel for OS X. Check with "conda list" that tensorflow is not already installed on your system. If it is, remove using
conda uninstall tensorflow
You can install 1.0.0 by installing from the conda-forge channel
conda install -c conda-forge tensorflow=1.0.0
For anaconda installation, first pick a channel which has the latest version of TensorFlow binary. The latest versions are usually available at the channel conda-forge. So, simply do:
# `-f` will force the current installation to upgrade
# `-c conda-forge` means we select `conda-forge` channel
$ conda update -f -c conda-forge tensorflow
This will upgrade your existing TensorFlow installation to the very latest version available. As of this writing, the latest version is 1.4.0-py36_0

Anaconda PyPi Installation

I'm trying to install a package not build in conda on Python 3.5 but founded on PyPi: "Seasonal"
https://pypi.python.org/pypi/seasonal
So I think I just have to do that :
conda skeleton pypi seasonal
conda build seasonal
conda install --use-local seasonal
It worked for an other one, but here I have this error :
((env-smart-data)) smartdata#smartdata-VirtualBox:~/PycharmProjects/TimeSerie$ conda skeleton pypi seasonal
Warning, the following versions were found for seasonal
0.3.1
0.3.0
0.2.0
0.1.0
0.0.0
Using 0.3.1
Use --version to specify a different version.
Error: Could not parse url for seasonal: UNKNOWN
So conda can find it, but there is a problem .. Any ideas ?
I've seen that seasonal is build on a Python 2.7, so I've tested it on a virtual env with Python 2.7, but it's exactly the same
If you can find it on PyPi, then you can simply do this:
pip install seasonal
Since you have conda installed, pip called here is actually calling anaconda's pip. Thus it will automatically handle install path etc.

How to revert to python 2 in conda root environment?

I created a new python3 environment to install python 3; due to the incompatibility between conda and Windows PowerShell, I installed python 3 in both of the root and python3 environment by accident. Is it possible to revert to python 2 in the root environment?
C:\Users\Nick>conda info --env
# conda environments:
#
python3 C:\application\anaconda\envs\python3
root * C:\application\anaconda
C:\Users\Nick>python -V
Python 3.3.5 :: Continuum Analytics, Inc.
conda install python=2 should do the trick. Definitely check and make sure that all packages downgraded successfully by inspecting the output of conda list for versions that contain the py3 string. For any packages that contain py3 in the version string, you should probably just uninstall/reinstall them.
(Hypothetical) Example:
The third column in conda list is the python version. If you see:
anaconda-client 1.1.2 py35_0 defaults
then you should
conda remove anaconda-client
followed by
conda install anaconda-client so that it installs the python 2 version.
Then conda list should show the anaconda-client line like this:
anaconda-client 1.1.2 py27_0 defaults.

Categories

Resources