Questions tagged [site-packages]

site-packages is the target directory of manually built Python packages (where Python installs its modules).

When you build and install Python packages from source you will find the installed modules in a folder named site-packages by default.

The standard installation location can be found here (see also installation documentation):

Unix (pure):

# prefix/lib/pythonX.Y/site-packages
/usr/local/lib/pythonX.Y/site-packages

Unix (non-pure):

# exec-prefix/lib/pythonX.Y/site-packages
/usr/local/lib/pythonX.Y/site-packages

Windows:

# prefix\Lib\site-packages
C:\PythonXY\Lib\site-packages

When you run Python, the module search path sys.path usually includes a directory whose path ends in "site-packages". This directory is intended to hold locally-installed packages available to all users using a machine or a particular site installation.

See PEP-370 for more information about "Per user site-packages directory", and this tutorial about virtual environments to see that the installation location can be different (isolated in that case).

108 questions
17
votes
4 answers

What does it mean to "Inherit global site-packages" in PyCharm?

When creating a new Python project, why would I want to select this option? If I don't select it, what functionality am I missing out on? Would I not be able to import certain Python modules?
Hayden Morgan
  • 187
  • 1
  • 1
  • 9
7
votes
0 answers

pytest ignore venv when called from shell without pytest.ini file

I am trying to use pytest within my Mac's terminal. I do not have a pytest.ini set up, and do not wish to make one at this time. When I run the command pytest alone, it prints warnings (DeprecationWarning) for multiple site packages within my…
Intrastellar Explorer
  • 3,005
  • 9
  • 52
  • 119
6
votes
1 answer

What is top_level.txt and when is it created?

Background From The Internal Structure of Python Eggs (hosted by python.org), I learned that there's a file called top_level.txt that is installed alongside Python eggs that says what top-level modules or packages are installed. packaging.python.org…
wheresmycookie
  • 683
  • 3
  • 16
  • 39
5
votes
6 answers

ModuleNotFoundError: No module named 'tensorflow.python.trackable'

The statement is: from tensorflow.python.trackable import base as trackable But the module not found error is coming up. ##### File "C:\Users\mahit\anaconda3\lib\site-packages\keras\dtensor\lazy_variable.py", line 26, in from…
MAHITHA POTTI
  • 86
  • 1
  • 4
5
votes
2 answers

Use another site-packages directory by default for setup.py install

I embedded Python in an application. When the user installs a package or module via {...}\myapp\python\python.exe setup.py install the packages will be installed in {...}\myapp\python\lib\site-packages Is there any chance to use another directory…
HelloWorld
  • 2,392
  • 3
  • 31
  • 68
4
votes
1 answer

Migrate site-packages/modules installed with pip from older to newer/latest version of python

At first, I moved the python modules installed in the /../python3.7/site-packages to the new /../python3.8/site-packages directory manually. To generalize the following question, I'm introducing the following nomenclature: The initial (lower)…
Andreas L.
  • 3,239
  • 5
  • 26
  • 65
4
votes
1 answer

Why won't my python module install?

I am trying to build a pulp distributor plugin which will execute a bash script containing arbitrary code so that I may trigger actions after an RPM repo is published. These plugins are generally created using distutils. However, when I attempt to…
James Shewey
  • 260
  • 2
  • 19
3
votes
4 answers

FileNotFoundError: Could not find module 'C:\Users\(path...)\site-packages\pyzbar\libzbar-64.dll' (or one of its dependencies

I am getting FileNotFoundError: Could not find module 'C:\Users(path...)\pythonProject\venv\lib\site-packages\pyzbar\libzbar-64.dll' (or one of its dependencies). Try using the full path with constructor syntax. But, as you can see in the screenshot…
Akash Sharma
  • 134
  • 1
  • 3
  • 13
3
votes
1 answer

What is the difference between the 'pkgs' directory and the 'site-packages' directory? [Anaconda]

[Anaconda3, Windows] What are the explicit differences between the directories 'site-packages' and 'pkgs' in my Anaconda3 (base python env) folder? Additionally, I would like to know why 'pkgs' is significantly larger in size than 'site-packages.'…
George
  • 120
  • 8
2
votes
1 answer

Python.exe in incorrect path despite adding path to Windows

I added the following python paths to the Path in Windows for system variables. C:\Project1\python\Python310-32\Scripts C:\Project1\python\Python310-32 When I run pip upgrade I get the following error: Unable to create process using…
Yash Jain
  • 442
  • 7
  • 19
2
votes
2 answers

Python mecab package import error on Windows 'not defined'

I am trying to install mecab on English OS Windows 10. I am using the command prompt and simply did; pip install mecab It looked like the package was installed; Collecting mecab Using cached mecab-0.996.3-cp39-cp39-win_amd64.whl (500 kB) Installing…
Sumi
  • 45
  • 7
2
votes
3 answers

How does Python know to import from the code i'm working on, rather than importing from site-packages?

Background I have a package i'm working on which i have also installed into site-packages. (I've installed my own package using pip) Question How does Python know to import from the "local" code (the code i'm working on), rather than importing from…
sunyata
  • 1,843
  • 5
  • 27
  • 41
2
votes
1 answer

run "python -m ensurepip --default-pip" but prompt me "Requirement already satisfied: pip in /usr/local/lib/python3.8/site-packages (19.2.3)"

I would like to use pip. Here I go: $ python -m ensurepip --default-pip Looking in links: /tmp/tmpd7_yb3oj Requirement already satisfied: setuptools in /usr/local/lib/python3.8/site-packages (41.2.0) Requirement already satisfied: pip in…
CY Ngan
  • 21
  • 1
2
votes
3 answers

Error while launching Jupyter Notebook - @attr.s(hash=True) AttributeError: module 'attr' has no attribute 's'

I am not able to launch or open Jupyter Notebook. I have uninstalled and installed it multiple times, still get the same error which I have pasted below! It's giving some 'Attribute Error'. Traceback (most recent call last): File…
2
votes
1 answer

How to copy manually only a single site package without pip install?

First, my reasons to do this - I know it's a bad idea but I am out of ideas. I want to install a package which requires a ld version, which is higher than the one in the repo of my Centos 6.5. So I should either go for setting up everything in a…
Nikolay Shindarov
  • 1,616
  • 2
  • 18
  • 25
1
2 3 4 5 6 7 8