2

This is based on Install Python Flask without using pip

My environment has no rpms installed or enabled, nor do I have pip, easy_install, virtualenv, etc.

Based on the answer in the linked question, I need to install setuptools in order to install Jinja.

To do this, I downloaded and un-tared setuptools-19.1.1.tar.gz. I then run the following command and get an ImportError:

$python setup.py install

 Traceback (most recent call last):
 File "setup.py", line 21, in <module>
 exec(init_file.read(), command_ns)
 File "<string>", line 11, in <module>
 File "/misc/scratch/flask-files/setuptools-19.1.1/setuptools/__init__.py", line 12, in <module>
 from setuptools.extension import Extension
 File "/misc/scratch/flask-files/setuptools-19.1.1/setuptools/extension.py", line 8, in <module>
 from .dist import _get_unpatched
 File "/misc/scratch/flask-files/setuptools-19.1.1/setuptools/dist.py", line 7, in <module>
 import numbers
ImportError: No module named numbers

Does anyone know where I can grab the numbers module? I can't find what that would be.

Thank you!

Community
  • 1
  • 1
roach
  • 73
  • 7
  • try install `psycopg2` – Assem Dec 21 '15 at 19:51
  • Shouldn't it be already included? https://docs.python.org/2/library/numbers.html – Dušan Maďar Dec 21 '15 at 19:52
  • I am in a linux environment, it would probably normally already be included but my environment is unique, it's pretty much a blank slate at this point. I am working on install psycopg2 right now – roach Dec 21 '15 at 19:58

2 Answers2

1

I found the answer to my own question. Using an Ubuntu machine I entered my python terminal using

python -v

and tried import numbers:

>>> import numbers
# /usr/lib/python2.7/numbers.pyc matches /usr/lib/python2.7/numbers.py
import numbers # precompiled from /usr/lib/python2.7/numbers.pyc
# /usr/lib/python2.7/__future__.pyc matches /usr/lib/python2.7/__future__.py
import __future__ # precompiled from /usr/lib/python2.7/__future__.pyc

This showed me that the numbers module was located in /usr/lib/python2.7. In my current environment, I have nothing in my /usr/lib/python2.7/site-packages directory. So I scp-ed all of the files from my working Ubuntu enviroment to my empty server, so that I have the numbers module available (plus anything else I might need in the future).

Now running python setup.py install on my setuptools works.

roach
  • 73
  • 7
0

You can copy the source code from github to your local file /usr/lib/python3.5/numbers.py.

tetafro
  • 477
  • 1
  • 10
  • 15