How to install pip packages in Anaconda? - python

I am trying to install pip packages inside Anaconda without success.
This is what I have tried
1) installation of pip in Anaconda in the base environment
(base) root#eris:/# conda install pip
2) installation of a package, e.g. nano, using pip
(base) root#eris:/# pip install nano
Unfortunately, when I call nano an error message says that nano command was not found.
When I run "conda list", in one output line I get
nano 0.10.0 pypi_0 pypi
This is what I get when I run "which -a pip"
/root/anaconda3/bin/pip
and this is what I get when I run "which -a python"
/root/anaconda3/bin/python
Simon

conda activate environt_name followed by pip install package_name should work and install the package in that specific environment (but only do it for packages that are not in a conda repository and use conda install otherwise).
Unfortunately, when I call nano an error message says that nano command was not found.
Beware that pip install nano will install the nano library from Pypi. From the output of conda list it seems that the library was installed. I have never used this library, but from its description in Pypi it is related to django and it does not seem to come with an executable. Don't confuse it with the nano text editor that comes with most linux distributions (the nano text editor needs to be installed using your distro package manager).

Related

Downgrading Python version on Ubuntu

Can someone please tell me how to downgrade Python 3.6.9 to 3.6.6 on Ubuntu ? I tried the below commands but didnot work
1) pip install python3.6==3.6.6
2) pip install python3.6.6
First, verify that 3.6.6 is available:
apt-cache policy python3.6
If available:
apt-get install python3.6=3.6.6
If not available, you'll need to find a repo which has the version you desire and add it to your apt sources list, update, and install:
echo "<repo url>" >> /etc/apt/sources.list.d/python.list
apt-get update
apt-get install python3.6=3.6.6
I advise against downgrading your system python unless you're certain it's required. For running your application, install python3.6.6 alongside your system python, and better yet, build a virtual environment from 3.6.6:
apt-get install virtualenv
virtualenv -p <path to python3.6.6> <venv name>
One option is to use Anaconda, which allows you to easily use different Python versions on the same computer. Here are the installation instructions for Anaconda on Linux. Then create a Conda environment by running this command:
conda create --name myenv python=3.6.6
Obviously your can use a different name than "myenv". You can then activate the environment in any terminal window:
conda activate myenv
Then you can pip install any packages you want. Some basics of anaconda environments can be found on the website's getting started page.

How to install Rasa NLU using Anaconda prompt

I have anaconda installed, and I use Anaconda Prompt to install python packages. But I'm unable to install RASA-NLU using conda prompt. Please let me know the command for the same
I have used the below command:
conda install rasa_nlu
Error:
PackagesNotFoundError: The following packages are not available from current channels:
- rasa_nlu
Use pip install rasa_nlu from Anaconda Prompt as mentioned in the documentation
if you are using anaconda prompt, close all your active py files and IDE and run the anaconda cmd as admin. Worked for me, if not install a c compiler
run : apt-get update && apt-get install build-essential
Then pip install rasa_core and nlu

install pip3 for conda

Python2.6 was installed by default in my old centos server. Now I want to create a Python3 environment to install python3 specific module by conda
conda create -n py3 python=3.5.3
source activate py3
After activate the py3, I try to install hovercraft by pip3 install hovercraft, the shell tells "command not found: pip3". At first I thought pip3 was installed with Python3, but the result was not the case.
So I think I can install it manually. The package gzip file was downloaded from python package index, and install by conda install --file hovercraft-2.3.tar.gz. But it doesn't work.
Now I have two problems:
how to install pip3 for virtual-env create by conda?
Is it possible to install python package index downloaded package locally in conda?
pip3 and pip would make a difference only when you are not using any environment managers like virualenv (or) conda. Now as you are creating a conda environment which has python==3.x, pip would be equivalent to pip3.

Installing QSTK in anaconda windows

i cannot get anaconda to install qstk. here is what i typed in cmd prompt.
conda install QSTK
But i guess that does not work because the continuum repos dont include QSTK. the error i get is No packages found matching qstk.
i checked the repos by typing the following in cmd prompt:
conda info
That told be the repo was continuum repo. so i checked http://repo.continuum.io/pkgs/free/win-32/index.html and found that QSTK is not there.
How do i install qstk in anaconda? I downloaded the qstk tar.gz file but i dont know how to install with it.
Did you try install it with pip install qstk?
If you have only one python version installed at your computer it should work.
Using easy_install -U QSTK in anaconda cmd prompt worked for me
In conda virtual environment I used following commands to install the package successfully:
1- pip install qstk
2- conda install matplotlib

Install python packages to correct anaconda environment

I've setup anaconda and created a python 3.3 environment. Now I wanted to install some package (dataset). The install instructions ask to clone the git repo and run
python setup.py install
but now the packages are not installed to the environments site-packages folder but to a different anaconda location.
What are the normal steps to solve that problem? Newbie-compatible solutions are preferred. The OS is MacOSX, just is case, it is relevant.
It looks like conda automatically adds pip to your conda environment, so after you source your conda environment, i.e.:
source activate ~/anaconda/envs/dataset
you should be able to install it like this:
git clone git://github.com/pudo/dataset.git
pip install ./dataset
EDIT
Here are the exact steps I took:
$ conda create -p ~/anaconda/envs/py33 python=3.3 anaconda pip
$ source activate ~/anaconda/envs/py33
$ which pip
~/anaconda/envs/py33/bin/pip
$ pip install ./dataset/

Categories

Resources