I have a setup.py that looks a bit (okay, exactly) like this:
#!/usr/bin/env python
from setuptools import setup
import subprocess
import distutils.command.build_py
class BuildWithMake(distutils.command.build_py.build_py):
"""
Build using make.
Then do the default build logic.
"""
def run(self):
# Call make.
subprocess.check_call(["make"])
# Keep installing the Python stuff
distutils.command.build_py.build_py.run(self)
setup(name="jobTree",
version="1.0",
description="Pipeline management software for clusters.",
author="Benedict Paten",
author_email="benedict#soe.ucsc.edu",
url="http://hgwdev.cse.ucsc.edu/~benedict/code/jobTree.html",
packages=["jobTree", "jobTree.src", "jobTree.test", "jobTree.batchSystems",
"jobTree.scriptTree"],
package_dir= {"": ".."},
install_requires=["sonLib"],
# Hook the build command to also build with make
cmdclass={"build_py": BuildWithMake},
# Install all the executable scripts somewhere on the PATH
scripts=["bin/jobTreeKill", "bin/jobTreeStatus",
"bin/scriptTreeTest_Sort.py", "bin/jobTreeRun",
"bin/jobTreeTest_Dependencies.py", "bin/scriptTreeTest_Wrapper.py",
"bin/jobTreeStats", "bin/multijob", "bin/scriptTreeTest_Wrapper2.py"])
It installs the package perfectly fine when run with ./setup.py install. However, it does this whether or not the "sonLib" package is installed, ignoring the dependency.
Is this expected behavior? Should a setup.py install blithely proceed if the dependencies are not installed, leaving it up to pip or whatever to install them beforehand? If not, and setup.py install ought to fail when dependencies are absent, what am I doing wrong?
EDIT: Some version information:
Python 2.7.2 (default, Jan 19 2012, 21:40:50)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import setuptools
>>> setuptools.__version__
'0.6c12'
>>>
The default install command for Distutils setup doesn't know anything about dependencies. If you are running that, you're right that dependencies will not be checked.
Just going by what you've show in the setup.py, though, you are using Setuptools for the setup function. The Setuptools install command is declared to run easy_install, which in turn does check and download dependencies.
It is possible you are explicitly invoking the Distutils install, by specifying install --single-version-externally-managed.
Related
I do not understand how Python can have multiple versions of a single package installed, or why, when I have multiple versions installed, import package does not give me the most recent one.
I am using AWS linux and the AWS repo in AWS EMR. When I install Python 3.6 it gives me Numpy version 1.14.5 by default. I want to use version 1.19.1 and have put it in a directory.
$ sudo pip-3.6 install --upgrade --no-index --find-links /mnt/packages/ numpy==1.19.1
Requirement already up-to-date: numpy==1.19.1 in /usr/local/lib64/python3.6/site-packages
$
But notice:
$ python
Python 3.6.11 (default, Jul 20 2020, 22:15:17)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.version.version
'1.14.5'
>>>
Because I have both version 1.14.5 and version 1.19.1 installed.
I can uninstall version 1.19.1 and then I can uninstall version 1.14.5, although it seems that I have to uninstall it twice (see below for the extended remix).
So how do I make it so that import numpy gets version 1.19.1 and not the older version?
$ sudo pip-3.6 uninstall numpy
Uninstalling numpy-1.14.5:
/usr/local/lib64/python3.6/site-packages/numpy-1.14.5.data/scripts/f2py
/usr/local/lib64/python3.6/site-packages/numpy-1.14.5.dist-info/METADATA
/usr/local/lib64/python3.6/site-packages/numpy-1.14.5.dist-info/RECORD
/usr/local/lib64/python3.6/site-packages/numpy-1.14.5.dist-info/WHEEL
/usr/local/lib64/python3.6/site-packages/numpy-1.14.5.dist-info/top_level.txt
/usr/local/lib64/python3.6/site-packages/numpy/.libs/libgfortran-ed201abd.so.3.0.0
/usr/local/lib64/python3.6/site-packages/numpy/.libs/libopenblasp-r0-39a31c03.2.18.so
/usr/local/lib64/python3.6/site-packages/numpy/_import_tools.py
/usr/local/lib64/python3.6/site-packages/numpy/add_newdocs.py
/usr/local/lib64/python3.6/site-packages/numpy/core/_dummy.cpython-36m-x86_64-linux-gnu.so
/usr/local/lib64/python3.6/site-packages/numpy/core/info.py
/usr/local/lib64/python3.6/site-packages/numpy/core/multiarray.cpython-36m-x86_64-linux-gnu.so
/usr/local/lib64/python3.6/site-packages/numpy/core/multiarray_tests.cpython-36m-x86_64-linux-gnu.so
/usr/local/lib64/python3.6/site-packages/numpy/core/operand_flag_tests.cpython-36m-x86_64-linux-gnu.so
/usr/local/lib64/python3.6/site-packages/numpy/core/struct_ufunc_test.cpython-36m-x86_64-linux-gnu.so
/usr/local/lib64/python3.6/site-packages/numpy/core/test_rational.cpython-36m-x86_64-linux-gnu.so
/usr/local/lib64/python3.6/site-packages/numpy/core/umath.cpython-36m-x86_64-linux-gnu.so
/usr/local/lib64/python3.6/site-packages/numpy/core/umath_tests.cpython-36m-x86_64-linux-gnu.so
/usr/local/lib64/python3.6/site-packages/numpy/distutils/__version__.py
/usr/local/lib64/python3.6/site-packages/numpy/distutils/compat.py
/usr/local/lib64/python3.6/site-packages/numpy/distutils/environment.py
/usr/local/lib64/python3.6/site-packages/numpy/distutils/info.py
/usr/local/lib64/python3.6/site-packages/numpy/f2py/info.py
/usr/local/lib64/python3.6/site-packages/numpy/fft/fftpack.py
/usr/local/lib64/python3.6/site-packages/numpy/fft/fftpack_lite.cpython-36m-x86_64-linux-gnu.so
/usr/local/lib64/python3.6/site-packages/numpy/fft/info.py
/usr/local/lib64/python3.6/site-packages/numpy/fft/tests/test_fftpack.py
/usr/local/lib64/python3.6/site-packages/numpy/lib/info.py
/usr/local/lib64/python3.6/site-packages/numpy/linalg/info.py
/usr/local/lib64/python3.6/site-packages/numpy/ma/version.py
/usr/local/lib64/python3.6/site-packages/numpy/random/info.py
/usr/local/lib64/python3.6/site-packages/numpy/random/randomkit.h
/usr/local/lib64/python3.6/site-packages/numpy/testing/decorators.py
/usr/local/lib64/python3.6/site-packages/numpy/testing/nose_tools/__init__.py
/usr/local/lib64/python3.6/site-packages/numpy/testing/nose_tools/decorators.py
/usr/local/lib64/python3.6/site-packages/numpy/testing/nose_tools/noseclasses.py
/usr/local/lib64/python3.6/site-packages/numpy/testing/nose_tools/nosetester.py
/usr/local/lib64/python3.6/site-packages/numpy/testing/nose_tools/parameterized.py
/usr/local/lib64/python3.6/site-packages/numpy/testing/nose_tools/utils.py
/usr/local/lib64/python3.6/site-packages/numpy/testing/noseclasses.py
/usr/local/lib64/python3.6/site-packages/numpy/testing/nosetester.py
Proceed (y/n)? y
Successfully uninstalled numpy-1.14.5
You are using pip version 9.0.3, however version 20.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ python
Python 3.6.11 (default, Jul 20 2020, 22:15:17)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>>
$ sudo pip-3.6 uninstall numpy
Uninstalling numpy-1.14.5:
/usr/local/lib/python3.6/site-packages/numpy-1.14.5.data/scripts/f2py
/usr/local/lib/python3.6/site-packages/numpy-1.14.5.dist-info/METADATA
/usr/local/lib/python3.6/site-packages/numpy-1.14.5.dist-info/RECORD
/usr/local/lib/python3.6/site-packages/numpy-1.14.5.dist-info/WHEEL
/usr/local/lib/python3.6/site-packages/numpy-1.14.5.dist-info/top_level.txt
/usr/local/lib/python3.6/site-packages/numpy/.libs/libgfortran-ed201abd.so.3.0.0
/usr/local/lib/python3.6/site-packages/numpy/.libs/libopenblasp-r0-39a31c03.2.18.so
/usr/local/lib/python3.6/site-packages/numpy/LICENSE.txt
/usr/local/lib/python3.6/site-packages/numpy/__config__.py
/usr/local/lib/python3.6/site-packages/numpy/__init__.py
/usr/local/lib/python3.6/site-packages/numpy/_distributor_init.py
/usr/local/lib/python3.6/site-packages/numpy/_globals.py
/usr/local/lib/python3.6/site-packages/numpy/_import_tools.py
/usr/local/lib/python3.6/site-packages/numpy/add_newdocs.py
/usr/local/lib/python3.6/site-packages/numpy/compat/__init__.py
/usr/local/lib/python3.6/site-packages/numpy/compat/_inspect.py
/usr/local/lib/python3.6/site-packages/numpy/compat/py3k.py
/usr/local/lib/python3.6/site-packages/numpy/compat/setup.py
/usr/local/lib/python3.6/site-packages/numpy/conftest.py
/usr/local/lib/python3.6/site-packages/numpy/core/__init__.py
/usr/local/lib/python3.6/site-packages/numpy/core/_dummy.cpython-36m-x86_64-linux-gnu.so
/usr/local/lib/python3.6/site-packages/numpy/core/_internal.py
/usr/local/lib/python3.6/site-packages/numpy/core/_methods.py
/usr/local/lib/python3.6/site-packages/numpy/core/arrayprint.py
/usr/local/lib/python3.6/site-packages/numpy/core/cversions.py
/usr/local/lib/python3.6/site-packages/numpy/core/defchararray.py
/usr/local/lib/python3.6/site-packages/numpy/core/einsumfunc.py
/usr/local/lib/python3.6/site-packages/numpy/core/fromnumeric.py
/usr/local/lib/python3.6/site-packages/numpy/core/function_base.py
/usr/local/lib/python3.6/site-packages/numpy/core/generate_numpy_api.py
/usr/local/lib/python3.6/site-packages/numpy/core/getlimits.py
/usr/local/lib/python3.6/site-packages/numpy/core/include/numpy/__multiarray_api.h
/usr/local/lib/python3.6/site-packages/numpy/core/include/numpy/__ufunc_api.h
...
/usr/local/lib/python3.6/site-packages/numpy/distutils/fcompiler/intel.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/fcompiler/lahey.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/fcompiler/mips.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/fcompiler/nag.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/fcompiler/none.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/fcompiler/pathf95.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/fcompiler/pg.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/fcompiler/sun.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/fcompiler/vast.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/from_template.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/info.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/intelccompiler.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/lib2def.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/line_endings.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/log.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/mingw/gfortran_vs2003_hack.c
/usr/local/lib/python3.6/site-packages/numpy/distutils/mingw32ccompiler.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/misc_util.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/msvc9compiler.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/msvccompiler.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/npy_pkg_config.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/numpy_distribution.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/pathccompiler.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/setup.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/system_info.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/tests/__init__.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/tests/test_exec_command.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/tests/test_fcompiler_gnu.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/tests/test_fcompiler_intel.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/tests/test_fcompiler_nagfor.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/tests/test_misc_util.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/tests/test_npy_pkg_config.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/tests/test_system_info.py
/usr/local/lib/python3.6/site-packages/numpy/distutils/unixccompiler.py
/usr/local/lib/python3.6/site-packages/numpy/doc/__init__.py
/usr/local/lib/python3.6/site-packages/numpy/doc/basics.py
/usr/local/lib/python3.6/site-packages/numpy/doc/broadcasting.py
/usr/local/lib/python3.6/site-packages/numpy/doc/byteswapping.py
/usr/local/lib/python3.6/site-packages/numpy/doc/constants.py
...
/usr/local/lib/python3.6/site-packages/numpy/testing/print_coercion_tables.py
/usr/local/lib/python3.6/site-packages/numpy/testing/setup.py
/usr/local/lib/python3.6/site-packages/numpy/testing/tests/__init__.py
/usr/local/lib/python3.6/site-packages/numpy/testing/tests/test_decorators.py
/usr/local/lib/python3.6/site-packages/numpy/testing/tests/test_doctesting.py
/usr/local/lib/python3.6/site-packages/numpy/testing/tests/test_utils.py
/usr/local/lib/python3.6/site-packages/numpy/testing/utils.py
/usr/local/lib/python3.6/site-packages/numpy/tests/__init__.py
/usr/local/lib/python3.6/site-packages/numpy/tests/test_ctypeslib.py
/usr/local/lib/python3.6/site-packages/numpy/tests/test_matlib.py
/usr/local/lib/python3.6/site-packages/numpy/tests/test_numpy_version.py
/usr/local/lib/python3.6/site-packages/numpy/tests/test_reloading.py
/usr/local/lib/python3.6/site-packages/numpy/tests/test_scripts.py
/usr/local/lib/python3.6/site-packages/numpy/tests/test_warnings.py
/usr/local/lib/python3.6/site-packages/numpy/version.py
Proceed (y/n)? Y
Successfully uninstalled numpy-1.14.5
You are using pip version 9.0.3, however version 20.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ sudo pip-3.6 uninstall numpy
Cannot uninstall requirement numpy, not installed
You are using pip version 9.0.3, however version 20.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ sudo pip-3.6 uninstall numpy
Cannot uninstall requirement numpy, not installed
You are using pip version 9.0.3, however version 20.2.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
$ python
Python 3.6.11 (default, Jul 20 2020, 22:15:17)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'numpy'
>>>
$ sudo pip-3.6 install --upgrade --no-index --find-links /mnt/gits/das-vm-config/dist/python numpy==1.19.1
Collecting numpy==1.19.1
Installing collected packages: numpy
Successfully installed numpy-1.19.1
$ python
Python 3.6.11 (default, Jul 20 2020, 22:15:17)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> numpy.version.version
'1.19.1'
>>>
Our solution is to do the following in the EMR bootstrap script (which gets run on every node):
Use yum to install python36 and python36-pip
use pip-3.6 with the --target option to install numpy-1.19.1 in /mnt/python_additions. We do this in the Bootstrap action so that it happens on every node.
Let Amazon's script install python36-numpy, which installs numpy-1.14.4 in the site library location.
In the program that gets called from spark-submit, add /mnt/python_additions to sys.path.
It's a hack, but it works.
I had just run into the same issue on my end. I ended up running the following 3 times to uninstall all numpy versions:
python3 -m pip uninstall numpy
Once it told me there is no numpy installed, I ran the install and it was able to give me the proper version.
Quite annoying, and wasn't an issue before.
Cross posting the answer which worked for me from another SO question: https://stackoverflow.com/a/69367430/2643556
Whilst you can have multiple versions of a package installed, only one is importable in a Python environment. If you want to be explicit about what versions of a package you want to use, So see where Python is importing packages from, you can run the following in an interactive session:
>>> import sys
>>> print(sys.path)
This will return a list of import locations. The last item in the list show the last place Python will look. Later paths in the list superceed, earlier ones. If you had the following:
["site_packages_path_with_numpy_1.19.1", "site_packages_with_numpy_1.14.5"]
Python would import numpy 1.14.5.
If you've not come across them, I suggest looking into virtualenv and requirements.txt.
Virtualenv allows you to create a local version of Python (separate from the system one) with whatever packages you want. Eg.
python -m venv .venv
source .venv/bin/activate
This will create a new copy of Python and actives it. Calls to Python or PIP will now use the virtual environment.
You can install packages into the virtual environment like so.
pip install numpy==1.19.1
Requirements allows you to keep a list of what packages you'd like to install. The file looks like so
# requirements.txt
numpy==1.19.1
You can install the contents of requirements into the virtual environment like so (assuming you've run the active command):
pip install -r requirements.txt
Finally, a more modern and arguably better solution is https://python-poetry.org/.
I am trying to download a library called Albow. I tried using pip to install it, but it didn't work, so I went to the Albow website and it linked to a .zip file. Basically what I want to do is to make it so that when I type:
import albow
Python recognizes it.
I'm using Python 3.5.3, on a Debian Linux VM. My PC's OS is using ChromeOS.
If I missed something that I should explain, I will edit the question.
The Albow website you linked to (or this other one from the Pygame projects) only supports Python 2. It's not available in PyPi so pip install would not work.
Since you tagged this python3.5, I assume you want Python 3 support.
There is a ported version available from PyPi: https://pypi.org/project/python3-albow/.
This project is a port of Gregory Ewing's Albow project (https://www.pygame.org/project/338/4687) that is only compatible with Python 2 and is unsupported since 2014.
You should be able to install it using standard pip install
$ python3.5 -m pip install --user python3-albow
...
Installing collected packages: pygame, python3-albow
Successfully installed pygame-1.9.6 python3-albow-2.7.8
$ python3.5
Python 3.5.9 (default, Nov 24 2019, 01:35:13)
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import albow
>>> albow.__path__
['/home/gino/.local/lib/python3.5/site-packages/albow']
>>>
Or, preferably, setup a virtual environment and install it there.
I'm trying to install python2.7 on linux from source on a system where I don't have admin rights. There is a version installed in /usr/bin but I want my install to be completely independent of this. I'm also testing builds with a newer gcc compiler so I want to avoid prebuilt packages like anaconda.
I downloaded python source and ran the following
./configure --prefix=$INSTALL_DIR --exec-prefix=$INSTALL_DIR --enable-shared --enable-optimizations --enable-unicode=ucs4
make
make install
where $INSTALL_DIR is where I want my install to go.
The configure and build ran without error, however, when I run the built python executable
$INSTALL_DIR/bin/python
and check the search paths it is still using /usr as the prefix:
Python 2.7.13 (default, May 31 2017, 17:58:17)
[GCC 7.1.1 20170503 (Red Hat 7.1.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.prefix
'/usr'
This means modules I install into $INSTALL_DIR aren't being found. Also running pip install XXX doesn't do anything if the module is already installed in the /usr space.
I'd like to avoid using things like $PYTHONPATH and $LD_LIBRARY_PATH so is there a way to set this up where sys.prefix and sys.path point to $INSTALL_DIR and know nothing about the system level install?
Thanks for your help.
Stop passing flags other than prefix to configre, and your python will give correct sys.path that stats with $INSTALL_DIR.
$ ./configure --prefix=$INSTALL_DIR
I'm trying to convert a project that I had installing fine with distribute over to a newer setuptools based installer. For some reason I can't get setuptools to run at all. When I run my setup.py I get errors from distutils about unsupported options which are all the extension options provided by setuptools. I can't figure out why setuptools isn't taking care of these correctly. This is on a Debian Wheezy system running Python 2.7.
I created a simple test case to demonstrate the problem. It is a standalone script that I want installed as a utility with an executable wrapper script:
foo.py
#!/usr/bin/python
def main():
print 'Foo main() ran'
if __name__ == '__main__':
main()
setup.py
from setuptools import setup
setup(name='foo',
version='1.0',
py_modules = ['foo'],
entry_points = {
'console_scripts': ['foo = foo:main'] # setuptools extension
},
include_package_data = True # another setuptools extension
)
The version of setuptools in the Debian package archive is 0.6.24 which predates the merger with distribute and I would prefer to use something that retains some of the distribute heritage. I've been installing various versions of setuptools with pip. The latest 4.0.1 won't install properly but most anything from 1.4 to 3.8 works:
$ sudo pip install setuptools==3.8
...
$ python
Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from setuptools import version
>>> version.__version__
'3.8'
The setuptools package/egg is placed in /usr/local/lib/python2.7/dist-packages which is normal on a Debian system when using pip.
When I try to install with my setup.py I get the following errors:
$ sudo python setup.py install
/usr/lib/python2.7/distutils/dist.py:267:
UserWarning: Unknown distribution option: 'entry_points'
warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267:
UserWarning: Unknown distribution option: 'include_package_data'
warnings.warn(msg)
running install
running build
running build_py
running install_lib
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/foo-1.0.egg-info
Writing /usr/local/lib/python2.7/dist-packages/foo-1.0.egg-info
Distutils installs foo.py to /usr/local/lib/python2.7/dist-packages/ but obviously the setuptools generated wrapper script is absent. I would have expected setuptools to do its subclassing/monkeypatching thing to take care of anything not supported by distutils.
I remember setuptools being cranky years ago which is why I settled on using distribute. It's disappointing that it still doesn't "just work". Is there anything obvious that I'm missing? I have a suspicion that this has something to do with Debian's use of the dist-packages directory in place of site-packages but that was never an issue with distribute.
Well it looks like the problem is that setuptools doesn't like being installed into /usr/local/lib/....
I forced pip to put it into /usr/lib/... with:
sudo pip install --install-option="--prefix=/usr/lib/python2.7/dist-packages" \
setuptools==3.8
setup.py installs cleanly after that.
I was trying to import setuptools in Python3.4 as following,
>>> from setuptools import setup
But I got the ImportError: No module named 'setuptools'.
My current version of Python3.4 is Python 3.4.0b1 (default, Nov 29 2013, 16:37:17), and it is installed using MacPorts.
So there is no setuptools module contained in Python 3.4 Standard Library, right? and I need to install setuptools module through pip?
Update:
setuptools is not in the standard library. But I cannot install it through pip because pip need setuptools installed first. MacPorts contains py34-setuptools #2.0.2 port and I can install setuptools through it.
setuptools has never been a part of the standard lib. You'll always to download it separately.
For 3.4, download setuptools - (This is the compressed download link!), extract it and install it via:
python setup.py install
You'll have to install it yourself. If you've got a completely empty environment in a new python installation, have a look at the official install instructions.
It works for me, but I'm using 3.4b2 on a Linux Mint system:
$ /usr/local/cpython-3.4/bin/python
Python 3.4.0b2 (default, Jan 5 2014, 13:53:24)
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from setuptools import setup
>>>