Cannot install jupyter - python-3.x

Every time I load jupyter notebook I get the error:
(venv) C:\Users\Kris\PycharmProjects\HelloWorld>jupyter notebook
'jupyter' is not recognized as an internal or external command,
operable program or batch file.
I reinstalled Pycharm, Python and Conda but the issue persists.
When running pip install jupyter, I do get some installation but it errors out at
Collecting MarkupSafe>=0.23 (from jinja2>=2.4->nbconvert->jupyter)
Downloading https://files.pythonhosted.org/packages/b9/2e/64db92e53b86efccfaea71321f597fa2e1b2bd3853d8ce658568f7a13094/MarkupSafe-1.1.1.tar.gz
Collecting pywin32>=1.0; sys_platform == "win32" (from jupyter-core->nbconvert->jupyter)
Could not find a version that satisfies the requirement pywin32>=1.0; sys_platform == "win32" (from jupyter-core->nbconvert->jupyter) (from versions: )
No matching distribution found for pywin32>=1.0; sys_platform == "win32" (from jupyter-core->nbconvert->jupyter)
How can I get Jupyter to install?

You can try this: python -m pip install jupyter and then python -m jupyter notebook.

Related

How do I update PIP repository in order to make new versions of python packages visible?

I'm setting up a RHEL8 (8.7) based Docker container, with Python 3.8.13 installed (installed python3-pip, python3.6, python 3.8 and 3.9 too). I have tried to install some Python libraries using requirements.txt:
RUN pip3 install -r requirements.txt
The txt file is recognized, some of the requirements are found and installed, but some of them are exiting with the failure code: 1
For example, I want to install joblib 1.2.0 and numpy 1.23.2, so my requirements.txt file has the following entries too:
joblib == 1.2.0
numpy == 1.23.2
But the build exits with the following as soon as it reaches the "joblib" line:
Collecting joblib==1.2.0 (from -r requirements.txt (line1))
Could not find a version that satisfies the requirement joblib==1.2.0 (from -r requirements.txt (line1)) (from versions: 0.3.2d.dev, ..*omitting a massive list of versions*.. 1.1.0, 1.1.1)
No matching distribution found for joblib==1.2.0 (from -r requirements.txt (line1))
error building image: error building stage: failed to execute command: waiting for process to exit: exit status 1
I have tried to install EPEL and probably install Python 3.10 or 3.11 but did not succeed, probably not supported by RHEL8.
I have gone through the following checks advised for cases when pip does not find the correct version:
pip install -r requirements.txt command is indeed running with the -r option.
version of pip is pip3, matching the installed Python3
name of the module is not misspelled, correct
the listed modules are not built-in modules (they indeed have to be installed separately)
package does support the version of Python:
Joblib 1.2.0 supported Python versions are 3.7+ (as stated, 3.8 and 3.9 is installed too)
Numpy 1.23.2 supported Python versions are 3.8-3.11
So these should be visible for pip3 installer - yet they are not, Joblib max offered version is 1.1.1...
Is there a workaround or solution for this?

Error installing open-cv | windows | anaconda | python 3.8

I am trying to install Open-cv on anaconda prompt but every time I start installation using
python -m pip install opencv-python
it shows me different errors, I have tried installing OpenCV using cmd but it shows:
Requirement already satisfied: opencv-python in c:\users\wajid\appdata\local\programs\python\python38-32\lib\site-packages (4.5.1.48)
Requirement already satisfied: numpy>=1.17.3 in c:\users\wajid\appdata\local\programs\python\python38-32\lib\site-packages (from opencv-python) (1.20.2)
what does this mean? Checked on jupyter notebook it shows:
ModuleNotFoundError: No module named 'cv2'
I have only single version of python installed on my laptop.

unable to locate pip packages using asdf in VSC

I have just installed a fresh install of BigSur and Python (using asdf) when installing pip packages they seem to end up in:
./.asdf/installs/python/3.9.2/lib/python3.9/site-packages
when typing which flake8 for example I get flake8 not found but when I go to install it again pip install flake8 I get the following:
> which flake8
flake8 not found
~
> pip install flake8
Requirement already satisfied: flake8 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (3.8.4)
Requirement already satisfied: pycodestyle<2.7.0,>=2.6.0a1 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (from flake8) (2.6.0)
Requirement already satisfied: mccabe<0.7.0,>=0.6.0 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (from flake8) (0.6.1)
Requirement already satisfied: pyflakes<2.3.0,>=2.2.0 in ./.asdf/installs/python/3.9.2/lib/python3.9/site-packages (from flake8) (2.2.0)
I have just tried to use requests which I installed like pip install requests and I also got not found when using which but I manage to use the package in VSC ok.
I am using flake8 and Black and I need to give VSC their paths. I have used
./.asdf/installs/python/3.9.2/lib/python3.9/site-packages/<package name>
but VSC doesn't seem to pip it up. I am using the latest verisons.
> python -V
Python 3.9.2
~
> pip -V
pip 21.0.1 from /Users/paul/.asdf/installs/python/3.9.2/lib/python3.9/site-packages/pip (python 3.9)
this might help too:
~
> which python
/Users/paul/.asdf/shims/python
~
> which pip
/Users/paul/.asdf/shims/pip
Any idea how I can get which to display the correct paths so I can get my listing and formatting working ok?
This fixed it... https://til.hashrocket.com/posts/ques11vrjs-get-pip-installed-executables-into-the-asdf-path
asdf reshim python
I would be curious why I have to do this...if anyone could answer

Could not find a version that satisfies the requirement tensorflow (from versions: none)

When i execute the command in my terminal
pip install --upgrade tensorflow
i get an error
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
There was a similiar question in stackoverflow. The cause for this error is that tensorflow supports only up to Python 3.7. So i checked my version
python3 --version3
--> 3.8.1
I tried to downgrade it with
conda install python=3.7
---> Collecting package metadata (current_repodata.json): done
Solving environment: done
# All requested packages already installed.
but it does not work. How can this be?
I am using manjaro as a distro.
Could the Python3.7 you're running be the 32-bit version? Tensorflow requires the 64-bit version of python.

Jupyterlab Package Directory

I'm having trouble importing pypyodbc in a jupyterlab notebook. I'm able to import it in a shell and even "old" jupyter notebooks. I've tried installing it via pip, conda, and manually. When I run !{sys.executable} -m pip install pypyodbc in the notebook it just shows:
Requirement already satisfied: pypyodbc in
c:~\appdata\local\continuum\anaconda3\lib\site-packages\pypyodbc-1.3.3-py3.6.egg
(1.3.3)
Requirement already satisfied: setuptools in
~\appdata\local\continuum\anaconda3\lib\site-packages
(from pypyodbc) (39.1.0)
I can import other packages just fine, but pypyodbc isn't working. What is the default package directory for jupyterlab, and how can I point it to a specific directory to import packages from?
It's possible you have multiple versions of Python running on your computer and Jupyter is selecting a version that does not have that package. To figure out what version of Python is running in your notebook do this inside Jupyter:
import os
import inspect
inspect.getfile(os)
Then you can run pip on that specific version:
python3.6 -m pip install pypyodbc
Alternatively, you can try to uninstall the package and reinstall via pip if it still doesn't work.

Resources