Forums

Error installing "phonenumbers"

Hello,

I'm new to PythonAnywhere and right now I'm trying to install an external module necessary for my web2py-based app.

I ran the command :

13:19 ~/web2py/site-packages $ pip install --user --target ./ phonenumbers

And got the following output :

Installing collected packages: phonenumbers
  Running setup.py install for phonenumbers
    error: can't combine user with prefix, exec_prefix/home, or install_(plat)base
    Complete output from command /usr/local/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip_build_{APP_NAME}/phonenumbers/setup.py';exec(compile(getattr(tokenize, 
'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-MEYhr4-record/install-record.txt --single-version-externally-managed --compile
 --user --home=/tmp/tmpziRuTm:
    running install

error: can't combine user with prefix, exec_prefix/home, or install_(plat)base

How can I solve this ?

[edited by admin: code formatting]

You can't combine --target with --user as arguments to pip install. --user carries an implicit target with it, so if you want to install phonenumbers into the specific directory, drop the --user and if you want to install it for for your account, drop the --target