![]() On Linux, you can install a package system-wide by doing so as the root user. If you jumped in here without reading the rest of the topic, please read the section above about installing packages in your user account or in a virtual environment first. Let me first repeat that I don’t recommend this. You just installed a package inside of your virtual environment, and as such it will only be accessible when you activate this venv. First, activate your virtual environment, and then type: pip install simplejson Now let’s try to install a package inside a virtual environment. It’s a great alternative to the standard Python REPL. Now, as an exercise, you could try to install ipython. On my system, this gives me the message that the requirement is already satisfied, meaning that pip is already up-to-date. These commands asked pip to install pip in your user account, and update it if it’s already installed. In that case, you can add the -user option to force it to install in your system account instead: pip install -user -upgrade pip If you get permission errors, it means pip tried to install it system-wide. As a result, if you don’t use something like sudo or become an administrator, you might get permission errors. Make sure you are not currently in a virtual environment and enter: pip install -upgrade pipĭepending on the Python installer you used and the system you are on, pip may try to install packages system-wide. So Let’s try to upgrade our account-wide pip installation first. In fact, installing packages in the local install directory is often the default these days when running outside of a virtual environment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |