5

On a RHEL machine

I have some old Django projects that I'm moving to a new server, these were written for Python2.6, Django1.4.3

I've installed python2.7, created the virtualenvs in my home directory, adjusted paths and references to the Python version.

I created a virtualenv for Python2.7:

virtualenv -p python2.7 ~/.virtualenvs/my_site/

When I activate the virtualenv and then cd into the web site directory and run

pip install -r requirements.txt

after successfully fetching all the libs, the following error is displayed for every line in requirements.txt:

Building wheels for collected packages: MySQL-python, Pillow...etc

Running setup.py bdist_wheel for MySQL-python ... error
Complete output from command /home/my_user/.virtualenvs/my_site/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-96k9a4/MySQL-python/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-ngSbQU --python-tag cp27:
  usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
     or: -c --help [cmd1 cmd2 ...]
     or: -c --help-commands
     or: -c cmd --help

  error: invalid command 'bdist_wheel'

I've found many other similar questions on stackexchange and other sites, and tried the fixes but no luck!

Why can I not create a wheel in python?

Why is python setup.py saying invalid command 'bdist_wheel' on Travis CI?

Can't build wheel - error: invalid command 'bdist_wheel'

I have pip 10.0.1

wheel IS installed (through pip install wheel), I've also run the following in my virtual env:

pip install --upgrade pip ('Requirement already up-to-date')
pip install setuptools --upgrade ('Requirement already up-to-date')
python setup.py bdist_wheel ('error: invalid command 'bdist_wheel'')

What else can I look at to fix this?

greebstreebling
  • 316
  • 1
  • 2
  • 13
  • Hi, I've updated the question with a bit more info, thank you. – greebstreebling Jun 29 '18 at 07:47
  • Are you sure that you are using the `pip` from the virtual env? You can use `which pip` to check. You can use `python -m pip` instead of `pip` to make sure you are using the correct `pip` for your `python`. – Alasdair Jun 29 '18 at 09:24
  • 'which pip' returns the path to the virtual env's pip. 'python2.7 -m pip install -r requirements.txt' has the bdist_wheel error – greebstreebling Jun 29 '18 at 10:07
  • I don't think it's going to help, but as one final idea you could try installing wheel, upgrading pip etc with `python -m pip` as well. If you've activated a virtualenv I would just use `python` instead of `python2.7`. – Alasdair Jun 29 '18 at 10:17
  • 'Requirement already up-to-date' for both unfortunately – greebstreebling Jun 29 '18 at 10:21

1 Answers1

8

Not sure why, but uninstalling wheel fixed it

I uninstalled wheel with a view to reinstalling it, but it worked without reinstalling.

pip uninstall wheel
greebstreebling
  • 316
  • 1
  • 2
  • 13