I am using scipy distribution scipy-0.4.9.win32-py2.4.exe with python 2.4 on Windows XP. When I try to import scipy I get the following error.

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in ?
    from scipy import *
  File "D:\Python24\lib\site-packages\scipy\__init__.py", line 33, in ?
    del lib
NameError: name 'lib' is not defined

Please help me :sad:

Recommended Answers

Please show us your code. On line 33 you have "del lib", you are trying to delete an object called "lib" that is not there.

Jump to Post

All 5 Replies

Please show us your code. On line 33 you have "del lib", you are trying to delete an object called "lib" that is not there.

I need help with this code:

File = open(test2.py)

OR

File = open("test2.py"r/w)

I am getting this error after i run it:

Traceback (most recent call last):
Traceback (most recent call last):
  File "C:\Users\Zeeshan\Desktop\test.py", line 11, in <module>
    File = open(test2.py)
NameError: name 'test2' is not defined

OR

Traceback (most recent call last):
  File "C:\Users\Zeeshan\Desktop\test.py", line 11, in <module>
    File = open("test2.py"/r)
NameError: name 'r' is not defined

Please Help!!
I am tring to make it open the file called test2.py
Both files are in the same folder.

Editor's note:
Please do not hijack old unrelated threads to post your questions in!
Have the common decency to start your own thread with the proper title.

commented: Dug up somebody else's 4 year old post and asked a new question instead of starting own thread. +0
Member Avatar

I need help with this code:

File = open(test2.py)

OR

File = open("test2.py"r/w)

I am getting this error after i run it:

Traceback (most recent call last):
Traceback (most recent call last):
  File "C:\Users\Zeeshan\Desktop\test.py", line 11, in <module>
    File = open(test2.py)
NameError: name 'test2' is not defined

Try

fh = open("test2.py", "r")

OR

Traceback (most recent call last):
  File "C:\Users\Zeeshan\Desktop\test.py", line 11, in <module>
    File = open("test2.py"/r)
NameError: name 'r' is not defined

Please Help!!
I am tring to make it open the file called test2.py
Both files are in the same folder.

Ditto.

fh = open("test2.py", "r")

I would avoid using variants of the keyword "file" for variable names.

Try

fh = open("test2.py", "r")

Ditto.

fh = open("test2.py", "r")

I would avoid using variants of the keyword "file" for variable names.

I have the same problem, when I try to open the test.py file, python gives a "SyntaxError: invalid syntax"

When I say:
open ("test.py")
Python respons is:
< open file 'test.py'mode 'r' at 0x00B29E0>
(What does this mean?)

The 'test.py' document has a code:
print 'hello world'

But python doesn't print it... So what do I have to do to make this work???

It means it is file object ready to use.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.