Here is what you can try.

  1. Lets check python installation.
C:\Users\User>python --version
Python 3.10.5

C:\Users\User>

If you get the version as 3.x, then we are good, else goto your python installation directory and copy its path and then add it to your environment variable PATH.

  1. Check PIP available or not.
C:\Users\User>pip --version
pip 22.3 from C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\pip (python 3.10)

C:\Users\User>

if above didn't work then add pip path to PATH environment variable which would be something similar to above output.

  1. Now we are ready to install any package

Just do pip install package-name for testing, you can try: pip install numpy If it still throws error, try below one python -m pip install numpy if it still throws error, then you might need to clean your python installation.

Answer from Anubhav Sharma on Stack Overflow
🌐
Python Packaging
packaging.python.org › tutorials › installing-packages
Installing Packages — Python Packaging User Guide
If you installed Python from source, with an installer from python.org, or via Homebrew you should already have pip. If you’re on Linux and installed using your OS package manager, you may have to install pip separately, see Installing pip/setuptools/wheel with Linux Package Managers.
🌐
Read the Docs
beautiful-soup-4.readthedocs.io › en › latest
Beautiful Soup Documentation — Beautiful Soup 4.4.0 documentation
Beautiful Soup 4 is published through PyPi, so if you can’t install it with the system packager, you can install it with easy_install or pip. The package name is beautifulsoup4, and the same package works on Python 2 and Python 3.
Discussions

Where do i store my python package locally if i want to access it from anywhere?
One way is to use pip to install your package; cd myproject python3 -m pip install . You may need to create a pyproject.toml: https://www.scivision.dev/python-minimal-package/ These modules, setuptools and wheel, are useful. https://packaging.python.org/en/latest/tutorials/installing-packages/#ensure-pip-setuptools-and-wheel-are-up-to-date More on reddit.com
🌐 r/learnpython
7
3
January 18, 2023
Best way to install python package with all its dependencies on an offline pc.
Either download the wheels manually or use a "portable" distribution of python More on reddit.com
🌐 r/Python
54
33
May 4, 2025
How do I install a python package manually without using any package manager?
Yes, that's a lot of what pip does. Pip will also save metadata next to the installed package so that importlib.metadata can work. But a lot of package manager complexity lies in figuring out what to install: selecting the correct wheel for your Python version + platform selecting package versions that don't conflict with each other also installing dependencies Sometimes, wheels are not available, only an sdist. Then, the package manager must set up a temporary build environment with the necessary build dependencies, build a wheel from that sdist, and then install it. More on reddit.com
🌐 r/learnpython
10
3
August 3, 2025
Why is it so hard to install libraries on python?
I’d suggest that you use Anaconda to manage your environments if you’re having trouble. More on reddit.com
🌐 r/AskProgramming
21
7
December 6, 2022
🌐
Python
docs.python.org › 3 › installing › index.html
Installing Python modules — Python 3.14.4 documentation
When using comparator operators such as >, < or some other special character which get interpreted by shell, the package name and the version should be enclosed within double quotes: python -m pip install SomePackage==1.0.4 # specific version ...
🌐
Playwright
playwright.dev › installation
Installation | Playwright Python
conda config --add channels conda-forge conda config --add channels microsoft conda install pytest-playwright
🌐
Cornell
portal.cac.cornell.edu › techdocs › software › install-python-in-python-virtual-environment
Install Python Packages in a Python virtual environment - CAC TechDocs
$ module load python3 (note: python3 ... might be something like python/3.6) $ python3 -m venv tensorflow $ source tensorflow/bin/activate (tensorflow)$ pip install --upgrade pip Collecting pip Using cached https://files.pythonhosted.org/packages/30/db/9e38760b32e3e7f40cce46dd5...
Find elsewhere
🌐
JetBrains
jetbrains.com › guide › python › tutorials › getting-started-pycharm › installing-and-managing-python-packages
Installing and Managing Python Packages - JetBrains Guide
March 30, 2023 - In both cases, you can select the -e checkbox to install the package in editable mode. You just saw how easy it is to install and manage Python packages in PyCharm. Another quick tip is that sometimes people install Python packages from the local terminal without having the virtual environment activated.
🌐
Python Packaging
packaging.python.org › en › latest › guides › section-install
Installation - Python Packaging User Guide
Analyzing PyPI package downloads · Discussions · Toggle navigation of Discussions · Versioning · Deploying Python applications · pip vs easy_install · install_requires vs requirements files · Distribution package vs. import package · Package Formats ·
🌐
ListenData
listendata.com › home › python
3 Ways to Install Python Package
In this tutorial, you will learn various ways to install python package or module.
🌐
Anaconda
anaconda.org
Anaconda.org
We cannot provide a description for this page right now
🌐
Ohio Supercomputer Center
osc.edu › resources › getting_started › howto › howto_install_your_own_python_modules
HOWTO: Install Python packages from source | Ohio Supercomputer Center
March 12, 2025 - To build the package, we will want to first create a temporary environment variable to aid in installation. We'll call INSTALL_DIR. ... We are roughly following the convention we use at the system level. This allows us to easily install new versions of software without risking breaking anything ...
🌐
Reddit
reddit.com › r/learnpython › where do i store my python package locally if i want to access it from anywhere?
r/learnpython on Reddit: Where do i store my python package locally if i want to access it from anywhere?
January 18, 2023 -

Im relatively new to python programming professionally (just over a year now) and i am at a point where i have code i have made that i want to use elsewhere. If i copy and paste the functions/classes, then any changes i make to them id need to make to them all. I understand the proper way of doing this is by making it a package.

I have made my code into a package, which i have working. But at the moment that package folder has to be in the save folder as the code im writing.

After some googling, ive found that you put them in the folder: /Library/Frameworks/Python.framework/Versions/3.9/lib

When i put it here, i still cant access it?

I am on mac os

I ran which python3 which is where i got the above path...

Any help would be great :)

🌐
CrewAI
docs.crewai.com › en › installation
Installation - CrewAI
Watch this video tutorial for a step-by-step demonstration of the installation process: Python Version RequirementsCrewAI requires Python >=3.10 and <3.14. Here’s how to check your version: ... OpenAI SDK RequirementCrewAI 0.175.0 requires openai >= 1.13.3. If you manage dependencies yourself, ensure your environment satisfies this constraint to avoid import/runtime issues. CrewAI uses the uv as its dependency management and package handling tool.
🌐
W3Schools
w3schools.com › python › python_pip.asp
Python PIP
Open the command line interface and tell PIP to download the package you want. Navigate your command line to the location of Python's script directory, and type the following: ... Now you have downloaded and installed your first package!
🌐
ITS Documentation
documentation.its.umich.edu › node › 5062
Installing libraries and packages / ITS Documentation
There are several ways that Python packages can be installed and managed. ARC support staff can install packages that can be made available to anyone who loads the appropriate module, while individuals can install packages for their own use. There are two main routes for users to install packages.
🌐
Conda
docs.conda.io › projects › conda › en › stable › user-guide › tasks › manage-environments.html
Managing environments — conda 26.3.1 documentation
To automatically install pip or another program every time a new environment is created, add the default programs to the create_default_packages section of your .condarc configuration file. The default packages are installed every time you create a new environment. If you do not want the default packages installed in a particular environment, use the --no-default-packages flag: conda create --no-default-packages -n myenv python
🌐
Solutions
solutions.posit.co › write-code › minimum-viable-python › installing-packages
Installing Python Packages – Solutions
WDAGUtilityAccount@mvp MINGW64 ~/Documents $ mkdir data-science-project WDAGUtilityAccount@mvp MINGW64 ~/Documents $ cd data-science-project WDAGUtilityAccount@mvp MINGW64 ~/Documents/data-science-project $ python -m venv .venv WDAGUtilityAccount@mvp MINGW64 ~/Documents/data-science-project $ tree -aL 3 . `-- .venv |-- Include |-- Lib | `-- site-packages |-- Scripts | |-- Activate.ps1 | |-- activate | |-- activate.bat | |-- deactivate.bat | |-- easy_install-3.9.exe | |-- easy_install.exe | |-- pip.exe | |-- pip3.9.exe | |-- pip3.exe | |-- python.exe | `-- pythonw.exe `-- pyvenv.cfg
Top answer
1 of 5
55

updated: 2019-05-11: This post mostly mentions virtualenv, but according to the Python doc about module installation, since Python 3.5 "the use of venv is now recommended for creating virtual environments", while virtualenv is an alternative for versions of Python prior to 3.4.

updated: 2018-08-17: since conda-4.4.0 use conda to activate anaconda on all platforms

updated: 2017-03-27: PEP 513 - manylinux binaries for PyPI

updated: 2016-08-19: Continuum Anaconda Option

This is somewhat a duplicate of easy_install/pip or apt-get.

For global Python packages, use either the Ubuntu Software Center, apt, apt-get or synaptic

Ubuntu uses Python for many important functions, therefore interfering with Python can corrupt your OS. This is the main reason I never use pip on my Ubuntu system, but instead I use either Ubuntu Software Center, synaptic, apt-get, or the newer just apt, which all by default install packages from the Ubuntu repository. These packages are tested, usually pre-compiled so they install faster and ultimately designed for Ubuntu. In addition all required dependencies are also installed and a log of installs is maintained so they can be rolled back. I think most packages have corresponding Launchpad repos so you can file issues.

Another reason to use either Ubuntu packages is that sometimes these Python packages have different names depending on where you downloaded them from. Python-chardet is an example of a package which at one time was named one thing on PyPI and another thing in the Ubuntu repository. Therefore doing something like pip install requests will not realize that chardet is already installed in your system because the Ubuntu version has a different name, and consequently install a new version which will corrupt your system in a minor insignificant way but still why would you do that.

In general you only want to install trusted code into your OS. So you should be nervous about typing $ sudo pip <anything-could-be-very-bad>.

Lastly some things are just easier to install using either Ubuntu packages. For example if you try pip install numpy to install numpy & scipy unless you have already installed gfortran, atlas-dev, blas-dev and lapack-dev, you will see an endless stream of compile errors. However, installing numpy & scipy through the Ubuntu repository is as easy as...

$ sudo apt-get install python-numpy python-scipy

You are in luck, because you are using Ubuntu, one of the most widely supported and oft updated distributions existing. Most likely every Python package you will need is in the Ubuntu repository, and probably already installed on your machine. And every 6 months, a new cycle of packages will be released with the latest distribution of Ubuntu.

If you are 100% confident that the package will not interfere with your Ubuntu system in any way, then you can install it using pip and Ubuntu is nice enough to keep these packages separate from the distro packages by placing the distro packages in a folder called dist-packages/. Ubuntu repository has both pip, virtualenv and setuptools. However, I second Wojciech's suggestion to use virtualenv.

For personal Python projects use pip and wheel in a virtualenv

If you need the latest version, or the module is not in the Ubuntu repository then start a virtualenv and use pip to install the package. Although pip and setuptools have merged, IMO pip is preferred over easy-install or distutils, because it will always wait until the package is completely downloaded and built before it copies it into your file system, and it makes upgrading or uninstalling a breeze. In a lot of ways it is similar to apt-get, in that it generally handles dependencies well. However you will may have to handle some dependencies yourself, but since PEP 513 was adopted there are now manylinux binaries at the Python Package Index (PyPI) for popular Linux distros like Ubuntu and Fedora. for example as mentioned above for NumPy and SciPy make sure you have installed gfortran, atlas-dev, blas-dev and lapack-dev from the Ubuntu repository For example, both NumPy and SciPy are now distributed for Ubuntu as manylinux wheels by default using OpenBLAS instead of ATLAS. You can still build them from source by using the pip options --no-use-wheel or --no-binary <format control>.

~$ sudo apt-get install gfortran libblas-dev liblapack-dev libatlas-dev python-virtualenv
~$ mkdir ~/.venvs
~$ virtualenv ~/.venvs/my_py_proj
~$ source ~/.venvs/my_py_proj/bin/activate
~(my_py_proj)$ pip install --no-use-wheel numpy scipy

See the next section, "You're not in sudoers", below for installing updated versions of pip, setuptools, virtualenv or wheels to your personal profile using the --user installation scheme with pip. You can use this to update pip for your personal use as J.F. Sebastian indicated in his comment to another answer. NOTE: the -m is really only necessary on MS Windows when updating pip.

python -m pip install --user pip setuptools wheel virtualenv

Newer versions of pip automatically cache wheels, so the following is only useful for older versions of pip. Since you may end up installing these many times, consider using wheel with pip to create a wheelhouse. Wheel is already included in virtualenv since v13.0.0 therefore if your version of virtualenv is too old, you may need to install wheel first.

~(my_py_proj)$ pip install wheel  # only for virtualenv < v13.0.0
~(my_py_proj)$ pip wheel --no-use-wheel numpy scipy

This will create binary wheel files in <cwd>/wheelhouse, use -d to specify a different directory. Now if you start another virtualenv and you need the same packages you've already built, you can install them form your wheelhouse using pip install --find-links=<fullpath>/wheelhouse

Read Installing Python Modules in the Python documentation and Installing packages on the Python Package Index main page. Also pip, venv, virtualenv and wheel.

If you're not in sudoers and virtualenv isn't installed.

Another option to using a virtual environment, or if you are using a Linux share without root privileges, then using either the --user or --home=<wherever-you-want> Python installation schemes with Python's distutils will install packages to the value of site.USERBASE or to wherever you want. Newer versions of pip also have a --user option. Do not use sudo!

pip install --user virtualenv

If your Linux version of pip is too old, then you can pass setup options using --install-option which is useful for passing custom options to some setup.py scripts for some packages that build extensions, such as setting the PREFIX. You may need to just extract the distribution and use distutils to install the package the old-school way by typing python setup install [options]. Reading some of the install documentation and the distutils documentation may help.

Python is nice enough to add site.USERBASE to your PYTHONPATH ahead of anything else, so the changes will only effect you. A popular location for --home is ~/.local. See the Python module installation guide for the exact file structure and specifically where your site-packages are. Note: if you use the --home installation scheme then you may need to add it to the PYTHONPATH environment variable using export in your .bashrc, .bash_profile or in your shell for your localized packages to be available in Python.

Use Continuum Anaconda Python for Math, Science, Data, or Personal Projects

If you are using Python for either math, science, or data, then IMO a really good option is the Anaconda-Python Distribution or the more basic miniconda distro released by Anaconda, Inc. (previously known as Continuum Analytics). Although anyone could benefit from using Anaconda for personal projects, the default installation includes over 500 math and science packages like NumPy, SciPy, Pandas, and Matplotlib, while miniconda only installs Anaconda-Python and the conda environment manager. Anaconda only installs into your personal profile, ie: /home/<user>/ and alters your ~/.bashrc or ~/.bash_profile to prepend Anaconda's path to your personal $PATH recommends sourcing conda.sh in your ~/.bashrc which lets you use conda activate <env|default is base> to start anaconda - this only affects you - your system path is unchanged. Therefore you do not need root access or sudo to use Anaconda! If you have already added Anaconda-Python, miniconda, or conda to your personal path, then you should remove the PATH export from your ~/.bashrc, and update to the new recommendation, so your system Python will be first again.

This is somewhat similar to the --user option I explained in the last section except it applies to Python as a whole and not just packages. Therefore Anaconda is completely separate from your system Python, it won't interfere with your system Python, and only you can use or change it. Since it installs a new version of Python and all of its libraries you will need at least 200MB of room, but it is very clever about caching and managing libraries which is important for some of the cool things you can do with Anaconda.

Anaconda curates a collection of Python binaries and libraries required by dependencies in an online repository (formerly called binstar), and they also host user packages as different "channels". The package manager used by Anaconda, conda, by default installs packages from Anaconda, but you can signal a different "channel" using the -c option.

Install packages with conda just like pip:

$ conda install -c pvlib pvlib  # install pvlib pkg from pvlib channel

But conda can do so much more! It can also create and manage virtual environments just like virtualenv. Therefore since Anaconda creates virtual environments, the pip package manager can be used to install packages from PyPI into an Anaconda environment without root or sudo. Do not use sudo with Anaconda! Warning! Do be careful though when mixing pip and conda in an Anaconda environment, b/c you will have to manage package dependencies more carefully. Another option to pip in a conda environment is to use the conda-forge channel, but also best to do that in a fresh conda environment with conda-forge as the default channel. As a last resort, if you can't find a package anywhere but on PyPI, consider using --no-deps then install the remaining dependencies manually using conda.

Anaconda is also similar in some ways to Ruby RVM if you're familiar with that tool. Anaconda conda also lets you create virtual environments with different versions of Python. e.g.: conda create -n py35sci python==3.5.2 numpy scipy matplotlib pandas statsmodels seaborn will create a scientific/data-science stack using Python-3.5 in a new environment called py35sci. You can switch environments using conda. Since conda-4.4.0, this is now different to virtualenv which uses source venv/bin/activate, but previous to conda-4.4.0 the conda commands were the same as virtualenv and also used source:

# AFTER conda-4.4 
~/Projects/myproj $ conda activate py35sci

# BEFORE conda-4.4 
~/Projects/myproj $ source activate py35sci

But wait there's more! Anaconda can also install different languages such as R for statistical programming from the Anaconda r channel. You can even set up your own channel to upload package distributions built for conda. As mentioned conda-forge maintains automated builds of many of the packages on PyPI at the conda-forge Anaconda channel.

Epilogue

There are many options for maintaining your Python projects on Linux depending on your personal needs and access. However, if there's any one thing I hope you take away from this answer is that you should never use sudo pip to install Python packages. The use of sudo should be a warning to you to be extra cautious because you will make system wide changes that could have bad consequences. You have been warned.

Good luck and happy coding!

2 of 5
32

I think best way for you would be to install Python packaging system like "python-pip". You can install it with Synaptic or Ubuntu Software Center.

Pip will allow you to easy install and uninstall Python packages, simply as pip install package. In your case it would be something like this from terminal:

sudo pip install tweeststream
🌐
PyPI
pypi.org › project › pip
pip · PyPI
pip is the package installer for Python.
      » pip install pip
    
Published   Feb 05, 2026
Version   26.0.1
🌐
Flask
flask.palletsprojects.com › en › stable › installation
Installation — Flask Documentation (3.1.x)
Python comes bundled with the venv module to create virtual environments. Create a project folder and a .venv folder within: ... Your shell prompt will change to show the name of the activated environment. Within the activated environment, use the following command to install Flask: ... Flask is now installed.