when I am at C:\Python27\python.exe
When I key in: 'cd\' and it appeared: '...'. I key in 'cd python2.7' and it appeared: 'Syntax Error: invalid syntax'.
so I try again.
I key in: 'cd\' and key in: 'python -m pip install -U pip'. It appeared : 'Syntax Error: invalid syntax'.
How should I solve it?
pip command is not a Python syntax :)
It’s an executable file. To run it from Python you have to use subprocess module. But for single run see below.
Just run it in cmd.exe console (press Ctrl+R, type cmd.exe, press Enter), not in python.exe:
python -m pip install -U pip
pip install -U pywinauto
or with full path (if you have few Pythons installed):
C:\Python34\Scripts\pip.exe install -U pywinauto
Related
I was following this tutorial when this error occurred. I would appreciate it if anyone could tell me what is going wrong here.
https://docs.djangoproject.com/en/3.0/intro/contributing/
(djangodev) (base) XXXX#XXXX-MacBook-Air hello_django % python -m pip
install -e /path/to/your/local/clone/django/
ERROR: /path/to/your/local/clone/django/ is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with svn+, git+, hg+, or bzr+).
This occurred after entering the following code
% git clone https://github.com/XXX/django.git
$ python3 -m venv ~/.virtualenvs/djangodev
$ source source ~/.virtualenvs/djangodev/bin/activate
~/.virtualenvs/djangodev/bin/activate
python -m pip install -e /path/to/your/local/clone/django/
The last command should be as executed as follows (After you are in the directory from where you did the clone command)
python -m pip install -e django
I needed to upgrade PostgreSQL from version 9.5 to version 11. After that, when I recreated my virtualEnv from a 'requirements.txt' file, I started giving the following error when installing the psycopg2 package:
Collecting psycopg2 == 2.6.2 (from -r conf/requirements.txt (line 50))
Using cached https://files.pythonhosted.org/packages/7b/a8/dc2d50a6f37c157459cd18bab381c8e6134b9381b50fbe969997b2ae7dbc/psycopg2-2.6.2.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
Error: could not determine PostgreSQL version from '11 .1 '
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-0Q7bhV/psycopg2/
After some research, I ran the following commands to try to solve, but it did not work:
sudo apt-get install postgresql-server-dev-all
sudo apt-get install postgresql-common
Finally, I noticed that version 2.6.2 of psycopg2 only supports version 9.5 of postgresql. For 11 you should use the latest version of psycopg2, that is, version 2.7.7. After you change the requirements.txt file, and the virtualEnv has been recreated correctly.
I hope it will be useful to others.
Go for this Command Python3 - sudo apt install libpq-dev python3-dev
I am very new to python and anaconda. I am trying to install tweepy using pip install command
pip install -i https://pypi.anaconda.org/pypi/simple tweepy
I had referring to this command in
https://anaconda.org/pypi/tweepy
I am getting the below error:
File "<ipython-input-3-57dd52ca9b36>", line 1
pip install -i https://pypi.anaconda.org/pypi/simple tweepy
^
SyntaxError: invalid syntax
Tried a lot searching for this, but could not find one which can solve this problem.
You're supposed to run that in your command shell, not a Python REPL.
I am new to Python (2.7) but I am trying to run a program that requires the "requests" module. I have installed pip using the get-pip.py script and registered the Python27 and Python27/Scripts paths as environment variables.
When I run "python -m pip install -U pip" it says the package is already up-to-date.
Following installation guides, when I run "pip install requests" I get a new command prompt line. I tried "easy_install requests" and get the same thing. I tried "pip install --verbose requests" and have the same behavior (so much for being verbose!).
I am running on Windows Vista Ultimate, using the command prompt as administrator.
Since the "python -m pip install -U pip" actually displayed something, on a hunch I tried:
"python -m pip install requests"
This worked! I don't know why any of the installation guides do not say to do this.
I am trying to install this one: https://pypi.python.org/pypi/textblob-aptagger and it says to use this code - but I do not know where to use it (command line and Python console do not work):
$ pip install -U textblob-aptagger
I installed easy_install and pip using exe files from
http://www.lfd.uci.edu/~gohlke/pythonlibs/
So when I use the command:
$ pip install -U textblob-aptagger
in the Python console I get this error:
File "<console>", line 1
$ pip install -U textblob-aptagger
^
SyntaxError: invalid syntax
Where should I use this installation command?
You run the executable from the command line, but since it's not in your PATH, you'll need to supply the full filepath. On my system pip is installed at C:\Python27\Scripts, so the command I would use to install textblob-aptagger would be C:\Python27\Scripts\pip.exe install -U textblob-aptagger. Yours will likely be located in a similar if not identical location.