I wanted to install the cusignal python package on windows and I was following the instructions on the following github link.
It says to run the following commands:
conda create --name cusignal-dev
conda activate cusignal-dev
conda install numpy numba scipy cudatoolkit pip
pip install cupy-cuda101
cd python
python setup.py install
But towards the last two lines, I have no idea what and where the setup.py file is located. There is also no such folder called python that is automatically created. Hence, I am unsure how I am supposed to install cusignal library on windows 10.
The instructions expect that you first clone the GitHub repository, which has such a python folder, then run those instructions, like
git clone https://github.com/rapidsai/cusignal.git
cd python
python setup.py install
Be sure your environment is activated when doing this.
Related
I have a device with python3.7 preinstalled, in which i have installed also python3.9. I managed to change the version I am using of python3 and now the command "python3" followed by the .py file runs with python3.9.
The problem is I tried installing pandas with pip3 but it does not work (it didn't work even in the preinstalled python3.7), so I found that in debian you can install package, for example in this case pandas, using "sudo apt-get install python3-pandas" but this command keeps installing pandas in python3.7 and not in python3.9 even if now "python3" refers to python3.9.
Has anyone ever encountered this problem and has a solution?
python3.9 -m pip install pandas
Venv
You could use a virtual environment (venv) for installing dependencies.
This venv could be project specific or global.
Run python3 -m venv .venv in your project folder to create a .venv folder, which holds the venv configuration.
Run source .venv/bin/activate to activate the venv. This will link pip3 from your python 3.9 version to the pip command.
Now you can do pip install pandas to install the pandas dependency into the venv.
Conda
Another solution would be to use Anaconda or Miniconda
https://pandas.pydata.org/pandas-docs/stable/getting_started/install.html
conda create -n name_of_my_env python
This will create a minimal environment with only Python installed in
it.
To put your self inside this environment run:
source activate name_of_my_env
On Windows the command is:
activate name_of_my_env
The final step required is to install pandas. This can be done with
the following command:
conda install pandas
Context: I have python 3.7 on my computer (Linux). Some package (tensorflow) needs a previous version of python to function.
In this post, a user suggested to install a previous version of python using the command:
conda install python=3.6
I am confused by this command, since I normally install python using apt or apt-get ( I am on ubuntu ). I think of python as being separate from anaconda.
apt install python=3.6
What is the difference between these two commands?
What you might want to do if you need a specific version of Python for a particular project is making a 'virtual environment'. Basically, that means that pip packages are installed within the project folder rather than in your bin folder somewhere on your computer. Virtual environment can also link to a version of python using something like virtualenv --python=/usr/bin/python2.6.
apt install python=3.6 will install in the standard bin folder of your distro.
conda install python=3.6 will check in which environment you currently are and install it there. It of course requires Anaconda installed and setup on your computer.
There are a lot of virtual environment management packages out there and I am not going to give an opinion on which is the best.
Note that if you install it using apt install, the version used in command line for python3 or python may be ambiguous, to be sure, you can specify the full path or make an alias for that path if there isn't one.
Setup
Conda virtual environment
Coding in a Jupyter notebook
Python version 3.6
I have Googled, searched through the Conda help, github help on this site as wel as found closely relevant questions, that just don't answer mine:
Conda install package from github including requirements.txt
Conda: installing local development package into single conda environment
That first one comes close though.
Basically my question comes down to:
For my code to work i need to import this repo: https://github.com/nicocanali/airtable-python
How can I get this to be used in my Jupyter Notebook?
I'll need to add it to my virtual environment. But how?
I ended up doing the following:
Install git in the virtual environment: (conda install git)
Clone the project. (git clone [URL])
Install the package (cd to package directory that contains setup.py.
Then run "python setup.py install").
Found the answer in the first part in this video: How to Install Python Package from GitHub
To install https://github.com/nicocanali/airtable-python to your jupyter.
Download the .zip of the repo from the github website.
To install it in jupyter enter the following command from the anaconda console.
pip install [path_to_.zip_file_on_pc]
Works on any github file
Found a simple solution here:
https://medium.com/i-want-to-be-the-very-best/installing-packages-from-github-with-conda-commands-ebf10de396f4
For example, to install the package located at
https://github.com/Netflix/metaflow, navigate to your desired environment in the Anaconda prompt, activate the environment, and then execute the following commands:
conda install git
conda install pip
pip install git+git://github.com/Netflix/metaflow.git
(Note that the git package is available in Anaconda Navigator, so can be installed from there instead of from the Anaconda prompt.)
I am using Anaconda Python 3.4 on a Windows 7 PC now. Recently I am trying to follow the instruction of the book High Performance Python to learn some profiling skills. To this end I need to use pip install to install several tools. Unfortunately, not all of them support Python 3, and I have to install Python 2.7 now.
Before installing Python 2.7, I would like to know how I should handle with such 2.7/3.4 coexisting system? How do I setup pip so that I could use pip install to install packages for different Python versions separately?
You can create a conda environment via:
conda create --name py27 python=2.7
and use this environment for your work with Python 2.7. Activate it with the command activate py27, going back to your root environment is just activate.
In the py27 environment you can install pip and all other packages you need.
pip is generally located at the Python27\Scripts and/or Python34\Scripts folder. If you wish to invoke pip directly in the command line, these folders should be in your PATH environment variable.
Now I would just rename pip.exe in Python34\Scripts into any other name, for example pip_for_3.exe. That way, when I install packages for Python27, I would just use:
pip install <package name>
and packages for Python34:
pip_for_3 install <package name>
Coexisting Python installations are not a problem, you just have to know which version is invoked every time. See this answer for the same idea.
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/