Difficulty in installing a package in Anaconda - python

There is a package that I wanted to install on Anaconda/Jupyter, called nutopy. The documentation about it is given here.
When I try to install it with Conda using:
conda install -c control-toolbox -c conda-forge nutopy
It keeps solving envirenement forever. Do you have an idea how to solve this problem?

There could be a few things, but main issues I see are that the package you want to use is only available for Python 3.7 (except on Linux, which has one 3.9 build) and you are prioritizing conda-forge channel in an Anaconda base. If you don't already have Python 3.7 in the base, Conda is probably wasting a ton of time trying to figure out how to solve this. And over-prioritizing Conda Forge packages in Anaconda base is crushingly difficult to solve.
General recommendation is to create a new environment, and include the ipykernel package if you want to use it as a Jupyter kernel
conda create -n nutopy -c conda-forge -c control-toolbox python=3.7 nutopy ipykernel
You can still launch Jupyter with base activated and then change kernels in the notebook.

Related

Spyder IDE plugins installation (spyder-unittest)

I am trying to install a plugin for the Spyder ide called spyder-unittest (description here).
I am using:
MacOS X Version 10.14.6
Anaconda Navigator 1.9.7
Spyder 3.3.6
Python 3.7
After a first attempt using the command
conda install -c spyder-ide spyder-unittest
the plugin did not work (i.e. the additional command Run unit tests was not available under the Run menu).
I also tried, without success:
conda install -c conda-forge spyder-unittest
I then uninstalled and installed once again Anaconda navigator, and tried conda install -c spyder-ide spyder-unittest. This time, I got a very lengthy output, indicating conflicts (please see image):
Now, I do not know what to do. Could someone please offer any help?
I also tried to install after going, through the Terminal, to the directory where I thought the Spyder plugins were installed. Same output as above.
Thank you very much in advance.
Cheers,
Orlando
I managed to install spyder-unittest without any errors on my computer.
I suggest creating a new environment to avoid any conflicts with other packages when installing.
First create a new environment using:
conda create --name env python=3.7
After creating the environment, activate it using conda activate env
Then install spyder-unittest using conda install -c conda-forge spyder-unittest

python cannot import graph-tool after installing it on a mac using brew (homebrew)

I used homebrew to install graph-tool on a macOS 10.14 using the command brew install graph-tool, but I cannot import it in python (that is installed through anaconda in /opt/anaconda3/bin/python). How can I make Python able to import graph-tool?
Prefer Conda Packages
If you want to use something in a Conda environment, then the best practice is to install through Conda. In this case, the graph-tool package is available through Conda Forge and can be installed with
conda install -c conda-forge graph-tool
Personally, since I started using Conda in 2016, I've found no reason to use Homebrew or MacPorts. There might be some exceptions, but this package isn't one.
conda install not working
Sometimes the packages you already have installed can conflict with the ones you want to add. This is especially the case when it comes to massive envs like the base in Anaconda. Best practice for using Conda is to avoid installing in base and instead create envs for each project or project type. This also helps you avoid breaking code you've already written because sometimes installs can trigger a version change in a package you were using.
In this case, you could make a new env, say foo, with
conda create --name foo -c conda-forge graph-tool
You can list any additional packages you know you'll need after graph-tool.

How to install the specific version of Python with Anaconda?

I want to install Anaconda with Python Version 3.6.5. If I install Anaconda3-5.2.0, It install Python 3.5.1. Where to download the Anaconda with Python 3.6.5. The Big Data Scripts work only with Anaconda Python 3.6.5.
Anaconda Downloads
The Anaconda distribution with Python 3.6.5 was version 5.2.0.1 You can download this from the Anaconda distribution archive. If you do install from this, then make sure to update Conda immediately after installation:
conda update conda
However, I strongly recommend the following alternate solution as better practice.
Miniconda + Anaconda environment
Reasoning
What is installed in the base environment is relatively fixed once installed. Ultimately, you don't want to mess with your base environment, so best practice is to have the latest version there. Fortunately, you don't have to install a full Anaconda distribution, but rather can use a lightweight Miniconda (or Miniforge) distribution and create a secondary environment for the purpose of having an Anaconda Python 3.6.5 distribution. In the long run this will give you better stability.
Steps
Download and install Miniconda or a Miniforge variant. Once that is working...
Create your Anaconda env:
conda create --name my_env -c anaconda python=3.6.5 anaconda=5.2.0
Use your new isolated env:
conda activate my_env
[1] I determined this by running conda create -n foo --dry-run -c anaconda python=3.6.5 anaconda and then examining the version of the anaconda package that Conda ended up with in the solve.
Also try
conda install python=3.6.5
but you may encounter some incompatibility issues with other packages.
Alternatively, you may want to try creating a new environment. From the anaconda prompt, create a custom environment and specify the repository channel to find the version
conda create --name py365 python=3.6.5 --channel conda-forge
Activate the new environment
conda activate py365
However, the activation will not be permanent, and you will need to activate each time you start the anaconda prompt.
In your anaconda prompt, you can manually update your python to the latest version with :
conda update python
In case you are not familiar with it, anaconda prompt is installed to your computer when you install anaconda. Just make a search for it on your computer.
You can refer to this post : How do I upgrade to Python 3.6 with conda?

Conda create is stuck at "solving package specifications"

I'm trying to create a Python 2.7 virtual environment with Anaconda so I can download some packages that are not compatible with Python 3.4. I'm working in Conda version 4.2.13.
When I type the command conda create -n chemistry python=2.7 anaconda the whole thing freezes at the solving package specifications stage.
Does anyone know what causes this or how I can go about fixing it?
Today I faced the same snag. It got fixed after updating my Anaconda Navigator.
Updating your Anaconda Navigator may fix your issue, too.
Try this:
conda create -n chemistry python=2.7
The initial command you use will try to install a package named anaconda. If you want to specify the channel when installing packages,you can add -c <channel>.For example:
conda install -c conda-forge tqdm
Had same issue while I was trying to install some packages. I tried updating python then all seemed working. Try it out
conda install python

How to install pydotplus for Python 3.5 on Windows64

What is a proven method for installing pydotplus for Python 3.5 on a 64-bit Windows(10) system? So far I haven't had any luck using conda or a number of other approaches.
It appears there are several viable options for both Linux Ubuntu and Windows for Python 2.7. Unfortunately it's necessary for me to use this particular configuration, so any suggestions would be greatly appreciated!
Try running anaconda prompt as 'administrator', then use:
conda install -c conda-forge pydotplus
What have you tried for conda? According to https://anaconda.org/conda-forge/pydotplus/files pydotplus is available from conda-forge for Windows x64 and Python 3.5. Typing
conda install -c conda-forge pydotplus
should work.
I had definitely tried that earlier but for some reason it wasn't working. However, thanks to your response I took another look at my configuration to see why that particular install package wasn't running properly.
I originally used Anaconda to install a dual Python 2.7/3.5 environment and while I was always able to run 3.5 without any issues in an IDE (Jupyter Notebook in this instance), the current environment had still automatically defaulted to 2.7. The quick way to check for this via the command window is:
C:\Users\Username\Anaconda\envs>conda env list
which should produce something like:
# conda environments:
#
py27 * C:\Users\Username\Anaconda\envs\py27
py35 C:\Users\Username\Anaconda\envs\py35
Note that there will be '*' next to the environment that is currently active. To switch, simply type 'activate' followed by the new desired environment name and the change should immediately be verified by the command prompt that is returned:
C:\Users\Username\Anaconda\envs>activate py35
(py35) C:\Users\Username\Anaconda\envs>
After making the environment change, I reran the conda install package for pydotplus that you mentioned:
conda install -c conda-forge pydotplus
and it worked perfectly!
Two other quick things to consider when installing pydotplus to ensure that it interacts correctly with GraphViz in your particular environment:
Make sure you're running the most up to date version of scikit-learn. More info is provided on the official website (http://scikit-learn.org/stable/install.html), including the quick update command: conda update scikit-learn
Verify that the GraphViz bin directory has been added to your User Path: (Why is pydot unable to find GraphViz's executables in Windows 8?)
I had the same issue. here what I did was,
first I ran the anaconda prompt as administrator and then give the command,
**conda install -c conda-forge pydotplus**
it worked for me well

Categories