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
Related
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.
I can see that the installation guide:
https://docs.cupy.dev/en/stable/install.html
is quite outdated and a note on the Github release page of v9.0.0a2:
https://github.com/cupy/cupy/releases/tag/v9.0.0a2
states that the older version supporting CUDA v11.1 did not work in the first place and all wheels have been removed from PyPi as a response. Trying to install CuPy with an updated pip, none of the wheels are back up. Is there still a version (for any CUDA version for that matter) that works on Windows then? Can I build the newer v9.0.0b1 on Windows from source maybe?
C:\Windows\system32>python -m pip install -U setuptools pip
Requirement already satisfied: setuptools in c:\users\c\appdata\local\programs\python\python38-32\lib\site-packages (51.1.2)
Requirement already satisfied: pip in c:\users\c\appdata\local\programs\python\python38-32\lib\site-packages (20.3.3)
C:\Windows\system32>pip install cupy-cuda111
ERROR: Could not find a version that satisfies the requirement cupy-cuda111
ERROR: No matching distribution found for cupy-cuda111
python2 is installed on every mac and I installed python3 and used it a lot with the standard libraries. Now I wanted to use pip3 as I did with pip and it says:
-bash: pip3: command not found
I downloaded get-pip.pyfound in StackOverflow's answers and with installing it I got:
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages
In addition to that I tested with which pip3 and there was no output, just the new line with the normal shell. And with which pip there is the location output like I expected:
/usr/local/bin/pip
I installed python3 with the package and last month I installed brew. Maybe this created the conflict because I think I had use pip3for some libraries my installation of python3.
(What possibility do I have to use python3 without having to uninstall python2 and python3 because I need both of them and got the answer that it's no problem to install both of them?)
Thanks #phd for linking to another question. With
alias pip3='python3 -m pip'
in ~/.bash_profile I can use pip3 as used.
But I do want to know if there is still a place where pip3 is located in python3 and how I can find it?
Thanks a lot.
macOS 10.12.6 / python 2.7.10 and 3.6.4
which python>> /usr/bin/python
which python3>> /usr/local/bin/python3
I have a reqs.txt file, containing many python requirements I need to install on a second computer. The file looks like this:
alabaster==0.7.9
anaconda-client==1.6.0
anaconda-navigator==1.4.3
astroid==1.4.9
astropy==1.3
Babel==2.3.4
backports.shutil-get-terminal-size==1.0.0
beautifulsoup4==4.5.3
bitarray==0.8.1
blaze==0.10.1
...
I am using
pip3 install -r reqs.txt --requirement=reqs.txt
and I get
me#pc:~$ pip3 install -r reqs.txt --requirement=reqs.txt
Collecting alabaster==0.7.9 (from -r reqs.txt (line 1))
Using cached alabaster-0.7.9-py2.py3-none-any.whl
Collecting anaconda-client==1.6.0 (from -r reqs.txt (line 2))
Could not find a version that satisfies the requirement anaconda-client==1.6.0 (from -r reqs.txt (line 2)) (from versions: 1.1.1, 1.2.2)
No matching distribution found for anaconda-client==1.6.0 (from -r reqs.txt (line 2))
for every single package in that reqs.txt file. Any ideas?
EDIT: The reqs.txt file was created with pip freeze. Even if I remove the version numbers, they still won't install. If I , however, do a
pip3 install alabaster
it will install with no problems.
The alabaster has no problem in it's installation, however anaconda-client isn't available in 1.6.0 using pip3 probably in your original environment you have a standalone installation of Anaconda so it's version is superior. Thus making the pip3 install -r reqs.txt not work, to work you could downgrade the version to one available in pip or install the conda environment on the second computer before running your command.
I have installed flake8 successfully:
$ pip install flake8
Downloading/unpacking flake8
Downloading flake8-2.5.4-py2.py3-none-any.whl
Downloading/unpacking mccabe<0.5,>=0.2.1 (from flake8)
Downloading mccabe-0.4.0-py2.py3-none-any.whl
Downloading/unpacking pep8!=1.6.0,!=1.6.1,!=1.6.2,>=1.5.7 (from flake8)
Downloading pep8-1.7.0-py2.py3-none-any.whl (41kB): 41kB downloaded
Downloading/unpacking pyflakes<1.1,>=0.8.1 (from flake8)
Downloading pyflakes-1.0.0-py2.py3-none-any.whl (152kB): 152kB downloaded
Installing collected packages: flake8, mccabe, pep8, pyflakes
Successfully installed flake8 mccabe pep8 pyflakes
Cleaning up...
$ pip list|grep flake
flake8 (2.5.4)
pyflakes (1.0.0)
But it doesn't appear in any of the directories under /usr (/usr/bin/, /usr/sbin/, /usr/local/...) i.e. "which flake8" doesn't show anything, so I can't use from the console manually to verify a script like in the instructions.
You should look in ~/.local/ the pip you have installed (from Ubuntu's repositories) is modified to prevent the user from installing packages globally. You'll need to look for something like ~/.local/bin/flake8 and then you'll want to update your shell config to do something like
export PATH="~/.local/bin:$PATH"
So that it finds the executables you install with pip.