anaconda can't install in jupyter notebook conda packages - anaconda

everything was Ok with jupyter notebook, but then I tried to install by:
!conda install --yes --prefix {syz.prefix} psycopg2-binary and I got this error in jupyter EnvironmentLocationNotFound: Not a conda environment: C:\Users\Anonymous\{sys.prefix}

You can't mix virtualenv or venv with conda environements.
Learn conda basics here: Managing conda environments

Related

No module named 'torch' in Jupyter Notebook but it is installed (Mac OS)

So when I try to import torch in jupyter notebook it gives the error no module named 'torch'.
I created a conda environment named "Thesis" where I work in and install my packages.
When I try these commands in my terminal it says the package is installed (see three images below):
torch1
torch2
torch3
I tried many commands to install the package:
pip install torchvision
python3 -m pip install torchvision
conda install pytorch torchvision -c pytorch
I also tried installing the package directly in the jupyter notebook itself via:
import sys
!{sys.executable} -m pip install torchvision
It at least shows something but I got the following dependency error
dependency error
I also created a kernel
ipython kernel install --name "thesis" --user
All did not help and I still receive the error in jupyter notebook.
Does somebody know how to resolve this?
I solved the problem by downloading and activating virtualenv with:
python3 -m pip install virtualenv
virtualenv <my_env_name>
source <my_env_name>/bin/activate
And getting the path in the jupyter notebook by:
import sys
print(sys.executable)
which outputs:
/Users/{username}/opt/anaconda3/bin/python
And installing the packages in the terminal via:
/Users/{username}/opt/anaconda3/bin/python -m pip install {package_name}

ModuleNotFoundError: No module named 'dask_geopandas'

i have dask, dask-core and dask geopandas installed as shown:
dask 2021.7.1 pyhd8ed1ab_0 conda-forge
dask-core 2021.7.1 pyhd8ed1ab_0 conda-forge
dask-geopandas 0.1.0a4 pypi_0 pypi
however, when importing I kept getting an error message :
"ModuleNotFoundError: No module named 'dask_geopandas'"
I wonder what has gone wrong with installation, thank you.
This could happen if pip install and conda install installed packages in different paths (this typically happens when the conda environment does not have its own pip).
A simple way out of this is to install everything with conda, so in this case you would run the following within your conda environment:
conda install -c conda-forge dask dask-geopandas
Alternatively, make sure that your conda environment has pip installed also and then run the pip within the conda environment:
conda install -c conda-forge dask pip
# if the conda environment is not activate, then activate it
# using: conda activate the_name_of_your_env
pip install dask-geopandas
In addition, there are specific instructions at https://geopandas.readthedocs.io/en/latest/getting_started/install.html#installing-with-pip about extra steps you may need to take when using pip - you might need a compiler available in your system.

how to install fastai on windows 10

I cant seem to install the right version of torch and I cant get fast ai libraries working
I try
Python 3.7
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1-cp37-cp37m-win_amd64.whl
pip3 install torchvision
Could not find a version that satisfies the requirement torch>=1.1.0 (from torchvision) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2)
No matching distribution found for torch>=1.1.0 (from torchvision)
I feel like I may of downgraded my gpu when I tried conda install fast ai
and then I tried pip and it couldnt find a file C:\Users\Admin\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\caffe2\python\serialized_test\data\operator_test
I finally got to the point where it said successfully installed six, pillow, and torch but torch is at 0.3 which is incompatiable.
pip3 install https://download.pytorch.org/whl/cu100/torch-1.0.1-cp37-cp37m-win_amd64.whl
pip3 install torchvision
expected to install pytorch or fastai nothing seems to work
You may try installing the course by creating a conda environment provided anaconda is already installed in your windows machine.
conda update conda
conda create -n fastai_conda python=3.6
conda activate fastai_conda
conda install fastai pytorch=1.0.0 -c fastai -c pytorch -c conda-forge
Or for installing CPU version you can use the below commands after the environment is created
conda install -c pytorch pytorch-cpu torchvision
conda install -c fastai fastai
You can check if installation went right with this command
python -m fastai.utils.show_install
You may further need to install ipykernel to use the conda environment in your jupyter notebook.For that activate environment and run the following commands:
conda install nb_conda_kernels
python -m ipykernel install --user --name fastai_v1 --display-name "fastai v1"
conda install ipywidgets

Run Jupyter notebook in an anaconda environment on Windows 10

I recently create a anaconda env by:
conda create -n tensorflow_env python=3.6
conda activate tensorflow_env
conda install -c conda-forge tensorflow
Then I install jupyter notebook in the tensorflow_env,
conda install jupyter
Then I run it with
jupyter notebook
I got a blank website:
Anyone knows what's going on here? I use windows 10. And the jupyter notebook works fine if I don't run it with in the tensorflow_env environment. But if I don't run the jupyter in that environment, I can't import tensorflow.
You may need to install additional package:
conda install nb_conda_kernels
and restart the Jupyter notebook server again.

Cannot install jupyter notebook

In windows 7, I try to install jupyter notebook using:
pip3 install jupyter
But I get error:
Command "python setup.py egg_info" failed with error code 1 in C:\Users\AppData\Local\Temp\pip-build-5in28fbw\pywinpty\
Best thing to do is to install Anaconda here
It includes its own "conda" terminal window for "windows", which will make it a lot easier for you to invoke jupiter notebook from the conda terminal, regardless of which folder you are in
First update if using linux system:
sudo apt-get update
sudo apt-get upgrade
Restart the system and try below steps:
Installing Jupyter with pip
As an existing or experienced Python user, you may wish to install Jupyter using Python’s package manager, pip, instead of Anaconda.
If you have Python 3 installed (which is recommended):
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install jupyter
If you have Python 2 installed:
sudo python -m pip install --upgrade pip
sudo python -m pip install jupyter
Congratulations, you have installed Jupyter Notebook! To run the notebook, run the following command at the Terminal (Mac/Linux) or Command Prompt (Windows Run CMD in Admin):
jupyter notebook
Update your setuptools and pip first then retry:
pip install --upgrade setuptools pip

Resources