473,723 Members | 2,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

'import site' failed; use -v for traceback

Hi There,

I've installed python2.4-dev on Unbuntu linux. When I run it, it gives
an error:

'import site' failed; use -v for traceback

(Get the same result if I uninstall it and install regular python2.4).

Using -v traceback gives:

'import site' failed; traceback:
ImportError: No module named site

Python is installed in:
/usr/bin/python
/usr/lib/python2.4

File listing of /usr/lib/python2.4:
aifc.py htmlentitydefs. py rlcompleter.py
anydbm.py htmllib.py robotparser.py
asynchat.py HTMLParser.py sched.py
asyncore.py httplib.py sets.py
atexit.py ihooks.py sgmllib.py
audiodev.py imaplib.py shelve.py
base64.py imghdr.py shlex.py
BaseHTTPServer. py imputil.py shutil.py
Bastion.py keyword.py SimpleHTTPServe r.py
bdb.py lib-dynload SimpleXMLRPCSer ver.py
binhex.py lib-old site-packages
bisect.py LICENSE.txt smtpd.py
bsddb locale.py smtplib.py
calendar.py logging sndhdr.py
CGIHTTPServer.p y _LWPCookieJar.p y SocketServer.py
cgi.py macpath.py statcache.py
cgitb.py macurl2path.py statvfs.py
chunk.py mailbox.py stringold.py
cmd.py mailcap.py stringprep.py
codecs.py markupbase.py _strptime.py
codeop.py mhlib.py sunaudio.py
code.py mimetools.py sunau.py
colorsys.py mimetypes.py symbol.py
commands.py MimeWriter.py symtable.py
compiler mimify.py tabnanny.py
config modulefinder.py tarfile.py
cookielib.py _MozillaCookieJ ar.py telnetlib.py
Cookie.py multifile.py test
csv.py mutex.py this.py
curses netrc.py _threading_loca l.py
dbhash.py new.py threading.py
decimal.py nntplib.py timeit.py
difflib.py ntpath.py toaiff.py
dircache.py nturl2path.py trace.py
distutils os2emxpath.py tty.py
doc pdb.doc tzparse.py
doctest.py pdb.py unittest.py
DocXMLRPCServer .py __phello__.foo. py urllib2.py
dumbdbm.py pickletools.py urllib.py
dummy_threading .py pipes.py urlparse.py
dummy_thread.py pkgutil.py UserList.py
email plat-linux2 user.py
encodings poplib.py UserString.py
filecmp.py posixfile.py uu.py
fileinput.py pprint.py wave.py
formatter.py pty.py weakref.py
fpformat.py pyclbr.py webbrowser.py
ftplib.py pydoc.py whichdb.py
getpass.py Queue.py whrandom.py
gettext.py quopri.py xdrlib.py
gopherlib.py reconvert.py xml
gzip.py regex_syntax.py xmllib.py
heapq.py regsub.py xmlrpclib.py
hmac.py rexec.py zipfile.py
hotshot rfc822.py
Have noticed that python-minimal is installed with Unbuntu and can't be
easily removed, but running "which python" shows it's running the
proper version (python2.4). Any ideas?

Many Thanks,

Huw

Jun 21 '06 #1
1 5765
hu*********@gma il.com wrote:
Hi There,

I've installed python2.4-dev on Unbuntu linux. When I run it, it gives
an error:

'import site' failed; use -v for traceback

(Get the same result if I uninstall it and install regular python2.4).

Using -v traceback gives:

'import site' failed; traceback:
ImportError: No module named site

Python is installed in:
/usr/bin/python
/usr/lib/python2.4

File listing of /usr/lib/python2.4:
where's the site.py file ?
Bastion.py keyword.py SimpleHTTPServe r.py
bdb.py lib-dynload SimpleXMLRPCSer ver.py
binhex.py lib-old site-packages
bisect.py LICENSE.txt smtpd.py
bsddb locale.py smtplib.py


</F>

Jun 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
8661
by: Dennis | last post by:
The setup: Windows XP Pro Python 2.3 GTK+ 2.2.1.2 and pyGTK 1.99.17 for Python 2.3 from http://www.pcpm.ucl.ac.be/~gustin/win32_ports/ I've downloaded and installed per the instructions the pyGTK and GTK+ for win32 from the above locations. Folowing the instructions, I import pygtk first, run pygtk.require('2.0') second and then import
2
6404
by: Markus Doering | last post by:
Hello, I just switched from 2.2 to Python 2.3. I am developing an XML/CGI interface to databases as a python package called "unitWrapper" containing several modules which ran fine under v2.2. Running Python2.3 under windows2000 I get import errors when a module imports another module of the same package with absolute package-names like this:
97
4421
by: Kjetil Torgrim Homme | last post by:
often when re-factoring code, I need to change the indent level of some chunk of code. due to the lack of an end marker, my Emacs has to use heuristics when re-indenting, and this will occasionally lead to mistakes. of course this is really _my_ fault, not Emacs', but it's annoying all the same. a colleague uses #fi, #yrt etc. to mark the end of blocks, but I don't find this satisfactory since neither Python nor Emacs has any...
5
2477
by: Steve Holden | last post by:
This is even stranger: it makes it if I import the module a second time: import dbimp as dbimp import sys if __name__ == "__main__": dbimp.install() #k = sys.modules.keys() #k.sort() #for kk in k:
2
2571
by: Jon | last post by:
It appears that (windows) python searches in the current working directory before looking in the local site-packages directory, or that '.' comes first in sys.path? The problem arises when I made the mistake of running a test program from the same directory where I built and installed my package. Python uses the package from the current directory, which misses the pyd files, instead of the site-packages package which has them installed. ...
3
6865
by: Jim Hill | last post by:
Well, I've found about a hundred thousand web pages where people have had the same problem I have but nary a page with a solution that works for me. I want to do a simple embed, so I've followed the example in the Extending and Embedding documentation: In the .c file, #include <Python.h>
6
2058
by: bhochstetler | last post by:
I am on a hp 11.11 machine doing a 64 bit python 2.5 build. When I get my python executable created and run it, I get the error: "import site failed" OverflowError: signed integer is greater than the maximum. This is happening in the convertsimple() routine when it tries to return a signed int:
2
1919
by: Fuzzyman | last post by:
A very odd error with Python 2.5 (both 2.5.1 and 2.5.2 from the official msi installers and running on Vista under Parallels on the Mac). 'import site' fails due to a string in sys.path that contains a huge number of null bytes. The error is actually in ntpath - I adjusted it to print the paths it is working with and a string on encountering the bad path.
9
2117
by: rsoh.woodhouse | last post by:
Hi, I'm trying to work out some strange (to me) behaviour that I see when running a python script in two different ways (I've inherited some code that needs to be maintained and integrated with another lump of code). The sample script is: # Sample script, simply create a new thread and run a # regular expression match in it. import re
0
8868
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9388
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9241
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9090
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8062
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5996
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4764
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3209
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2149
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.