what are site directories in python ? are these some special folders ?

4
Contributors
10
Replies
14
Views
5 Years
Discussion Span
Last Post by krystosan
Featured Replies
• 1

> i have to copy paste my downloaded python packages for them to work? You do not copy/paste into site-packages folder yourself,you can but that's not the correct way(and it may not work). 3 methods: First the manual way. You download a packages extract to where-ever you want. From command …

Something like C:\Python33\Lib\site-packages is a directory Python will automatically look into.

oh! is it where i have to copy paste my downloaded python packages for them to work?

i have to copy paste my downloaded python packages for them to work?

You do not copy/paste into site-packages folder yourself,you can but that's not the correct way(and it may not work).

3 methods:
First the manual way.
From command line cmd naviagte to extract folder then write python setup.py install
Under this install will files go to site-packages folder and package is installed.

There are two tool for eaiser install easy_install and pip(recommended)
pip also have an uninstall function for packages.
Both of these tool will download a package from web and install it.
So as an example from cmd you write pip install numpy then download and install happens automatically.

Rembere to check environment variables Path
In Path if not there add ;C:\python27\;C:\python27\scripts
Or for python 3 ;C:\python33\;C:\python33\scripts
Restart to make it work.
This can be needed to be correct for all method i postet over to work fine.

Edited by snippsat

is their a quick way to add that path (e:\pythonpacks) to site directory without having to copy them to C:\Python26\Lib\site-packages

Add e:\pythonpacks to the PYTHONPATH environment variable (or create the variable).

Edited by Gribouillis

well but then isnt it almost equal to doing copy paste becuase i downloaded to this folder and extracted, this is really getting confusing to me.. now..

You don't have to download the packages in the folder where they will be installed. As Snippsat said above, suppose you download a package foo.zip, then uncompress it, producing a folder foo with a setup.py file. You must open windows cmd console. In the console, type cd C:\path\to\folder\foo and enter, then type python setup.py install, enter. The package installs itself automatically in site-packages.

Edited by Gribouillis

this helps however some of my packages dont contain a setup.py just

__init__.py


with other py files, i guess i would have to manually copy these ones..?

Do you have many of those modules ? You can try to move the folder with the __init__.py to site-packages and see if the module works.

Edited by Gribouillis

yes i did, gr8 , however I aded the path (e:/pythonpacks) to sys.path.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.