user1626276
user1626276

Reputation:

setuptools error in python

i am new to python and i am installing python pakages but i get this error

Error:
    Traceback (most recent call last):
      File "setup.py", line 3 in <module>
        from setuptools import setup, find_packages
    ImportError: No module named setuptools

but when iam installing setuptools and run it i get this error

Traceback (most recent call last):
  File "C:/Python32/yyy.py", line 7, in <module>
    execfile(convert_path('setuptools/command/__init__.py'), d)
NameError: name 'execfile' is not defined

i am windows 7 user . if any 1 have experience about it please figure it out and whats this mean Unpack the archive, enter the pyserial-x.y directory and run ? mean i have to install it from command prompt

i want to use twitter api in python . when i run its setup file it show error . i open it with notepad and copy the setup code and paste it in script and save it with yyy.py and run it and now it give me the error like this

File "C:\Python26\twittersetup.py",
line 13, in <module> 
long_description=open("./README", "r").read(), 
IOError: [Errno 2] No such file or directory: './README'

this errorr in python 3.2

File "C:/Python32/t.py",
line 9, in <module> 
setup(name='twitter',
NameError: name 'setup' is not defined

AND NOW AFTER MANY SURVIVALS I GOT THIS ERROR

Traceback (most recent call last):
File "C:\Users\Sheikh\Desktop\twitter-1.9.0 (1).tar\twitter-1.9.0\setup.py",
line 47, 
in <module>""",File "C:\Python32\lib\distutils\core.py",
line 136, in setup
raise SystemExit(gen_usage(dist.script_name) + "\nerror: %s" % msg)
SystemExit: usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: no commands supplied

Upvotes: 4

Views: 18640

Answers (3)

Ashwini Chaudhary
Ashwini Chaudhary

Reputation: 250871

execfile() will only work in Python 2, use exec() in Python 3

From http://pypi.python.org/pypi/setuptools/ it is clear that setuptools is only available for python 2.3, 2.4, 2.5, 2.6 and 2.7, so better install it on one of them not on 3.x.

Read Alternative to execfile in Python 3.2+?


Edit: Setuptools now support Python 3.3+.

Upvotes: 2

user1626276
user1626276

Reputation:

First you need to install setuptools from pypi and then you need to run setup.py file through commands using cmd. Using setup.py --help-commands in Windows tell you the step and commands.

Upvotes: 1

stderr
stderr

Reputation: 8722

setuptools doesn't appear to support python 3 (at least according to the Python Package Index).

Try distribute which provides the setuptools api and provides python3 compatibility: http://pypi.python.org/pypi/distribute

It looks like python-twitter does not support python3 so you'll have to use Python 2.6.

The 2.6 error message is pretty clear:

"C:\Python26\twittersetup.py", line 13, in <module> long_description=open("./README", "r").read(), IOError: [Errno 2] No such file or directory: './README') 

Basically you're attempting to run the script from another directory than the directory that contains the README file.

I'd start over and make sure you start by downloading and unpacking the complete source for python-twitter: http://pypi.python.org/packages/source/p/python-twitter/python-twitter-0.8.2.tar.gz

Next, uncompress and unpack the source (7-Zip works nicely for this).

Then open up cmd and cd to that unpacked directory (which should include the README file and the setup.py file). Then run something like:

C:\Python2.6\python2.6.exe setup.py

Upvotes: 2

Related Questions