![]() Python: aliased to /usr/local/bin/python3 Pip 21.1.2 from /usr/local/lib/python3.9/site-packages/pip (python 3.9) * system (set by /Users/johnDoe/.pyenv/version) I know i must have used pyenv but is it possible now ? after 2 versions already installed? ➜ ~ pyenv versions I made an alias for python 3.9.5 to be default in. I upgraded pip without pyenv, so now both pip and pip3 refer to python 3.9.5 Preinstalled with python2.7.16 & python 3.9.5 Messed up pip for python 2.7.16 and upgraded it to pip v 21.1.2 Things are a lot easier on linux side though so you should be good But before you install anything new, I would strongly suggest that you make sure you deleted all python related things (all those which commands and stuff I posted should return nothing or did you mean questions). For linux I would suggest deleting all python installations (google it) and simply installing via apt install or by installing miniconda. You're following the wrong guide, this is for macos. Oh no, looks like you're on a linux machine. I tried ech one of them, some did not give any output (which pip, which pip2, which pip3) /usr/bin/pythonĬommand 'pip3' from deb python3-pip (20.0.2-5ubuntu1.3)Ĭommand 'pipx' from deb pipx (0.12.3.1-2ubuntu1) Now do me a favor and end aging before I die. If you ever accidentally use sudo pip, come back here and apply the steps related to permissions again Always omit the sudo part of that instruction. There are a lot of posts online that use sudo pip to install packages in their instructions. This is not only true for python, but also nodejs for example, and other environments. sudo is the biggest source of confusion with python packages as it screws up the permissions. If you want to maintain the serenity that you have just gained, you have to remember one rule: Never ever use sudo pip install. I just tried a bunch of packages like numpy and plotly they all worked right away Golden rule Ok, if you haven't screwed up anything so far, you should be able to use pip with a peace of mind. (this installs latests python, which is right now python3. (source: ) Install python3 brew install python Now install python2 using brew: brew install (this will also install pip) ⚠ (If you're using macos on arm, add these two lines instead): export PATH="/usr/local/bin:/usr/local/sbin:$PATH"Įxport PATH="/usr/local/bin:/usr/local/sbin:$PATH"Įxport crossed python2 installation as it is no longer relevant] If you don't have brew installed (firstly you should be ashamed of yourself):.Here is the trick: We are NOT using easy_install. Now that you fixed the permissions, you can go ahead and install a python2 interpreter that will NOT ever require sudo with pip and hence will install your packages just fine: (don't worry we will get to python3 as well) That's why we made everything belong to us Let's install the one and only python2 we will use!: That's why the next step is so important:īasically, everything in this folder is supposed to NOT require root priviliges, which if they do they give pip a hard time later on. Thus any attempt to install new python versions will seem to work fine for now, but will be a brat later on. Then there is a good chance you messed up permissions with some packages too. Here's the fun part: if you already messed up your python environment, What's important is how you install the new version. ![]()
0 Comments
Leave a Reply. |