Windows 10 Pip No Output - python

I have installed pip on my Windows 10 laptop the same way I have been doing for the past few years (via python -m pip install -U pip setuptools). The weird part is, on my laptop, Pip causes no output. It just causes a blank line. For example
C:\Users\...> pip install hvjkdfghfdkghdkgf
C:\Users\...>
When it should throw an error that the module hvjkdfghfdkghdkgf does not exist.
I have read that you must edit the configuration file, but when I checked where the configuration file should be, there was none to be found. I tried creating the configuration file, and there was no change (I do not remember where, as this was over a month ago, sorry).
I have tried pip install ___ -v, and pip install ___ --verbose as found on the pip website: https://packaging.python.org/tutorials/installing-packages/#install-pip-setuptools-and-wheel, and still no luck.
Thanks in advance.
[EDIT]
By the way, It still installs modules, I just want to be able to see the progress of the installation, and if the module was even found.

I uninstalled pip:
python -m pip uninstall pip setuptools
And then followed the instructions here:
https://pip.pypa.io/en/stable/installing/#do-i-need-to-install-pip
By first downloading setup.py from https://bootstrap.pypa.io/get-pip.py, and running > python get-pip.py in the command line in the directory where the python file is saved.
Thanks anyways.

Related

Error installing Jupyter on Windows 10 using pip

I am new to Stack Overflow, so please forgive me for any errors.
I am trying to install Jupyter on my Windows 10 machine using command prompt. I have already installed Python(3.8.0).
I receive the following error at the end:
The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.
This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand. Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.
The installation starts, download the necessary file but suddenly there's a long list of error with the above message at the end. I have tried running command prompt as administrator but that also fails.
I have tried executing following commands for installation but nothing works:
> pip install jupyter
> python3 -m pip install --upgrade pip
python3 -m pip install jupyter
> pip install jupyterlab
Can someone tell me why this is happening? And how do I solve it?
Thank You!
I am on Windows 10, and using Pyhton 3.8. Running first
pip install setuptools --upgrade
and then
pip install notebook
worked for me quite well. Thanks to #roberto
Check the answer here.

Pip is installed to python3.6 but I'm using python3.7 with VS Code on Ubuntu 18.04

I am new to python and ubuntu to be fair. I have been recently following a couple of tutorials and they use pylint to check the syntax of the python code.
I've installed it as normal through the terminal using 'sudo pip3 install pylint', however whenever I format in VS Code I get an error stating pylint does not exist, do I want to install. On the attempt to install, i get another error due to pip not existing.
I've looked in the terminal after attempting to reinstall pip and pylint, however it's going to the python3.6 folder and not python3.7 folder, hence the errors.
Any ideas on how to resolve this?
Pip output is currently: "pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)"
If i try to install pylint via the terminal using "python3 -m pip install pylint", I get the output error of: "/usr/local/bin/python3: No module named pip"
After following stovfl's suggestions i realised that python 3 needed redirecting to the 3.7 install
I googled and found this article: http://ubuntuhandbook.org/index.php/2017/07/install-python-3-6-1-in-ubuntu-16-04-lts/
At step 3, it tells you how to makepython3 use the new install with the following command:
sudo update-alternatives --install /usr/local/bin/python3 python3 /usr/bin/python3.7 1
Now when I intall pip and pylint it directs to the new 3.7 folder. Meaning it also works as intended with VS Code.

get-pip.py broken on Windows 10

Get Pip (Python file from Pypa.io) on Windows 10 is not extracting on my laptop. I followed all the instructions on pypa.io - Installing, however, when I tried to execute the file, despite many attempts to fix this, it says:
ERROR: To modify pip, please run the following command: C:\Python27\python.exe -m pip
So I ran C:\Python27\python.exe -m pip and then it shows another error message:
C:\Python27\python.exe: No module named pip
I then consulted with a friend of mine, and he said that the second error message is obviously not a file error, but (me reflecting now) is quite logical. Of course it says that there is no module named pip because that was the very thing that I am trying to download. Then it occurred to me that Python must think that I already have it because it is asking me to modify pip. So I looked into this and saw that I had a pip folder but nothing inside it to do with Python.
So this made me think Why is it not downloading?
or Why does it think that I already have it?
UPDATE
The Python installer now comes with an option to install pip which should solve any further problems!
Pretty sure that I had the exact same problem as you. I am using Python 2.7.14 64-bit, and when I try to install pip using get-pip.py, I get the exact same error.
I fixed this by simply running the following command:
python -m ensurepip --default-pip
This then installed pip. This is because the version of Python I downloaded is packaged with pip.
Note that this installed pip without the wheel portion, so I then had to run:
python -m pip install --upgrade pip setuptools wheel
After that, everything was ready to go.
I just stumbled upon this very same issue. However, I am using (have to) Python 2.7.8 32-bit.
https://pip.pypa.io/en/latest/installing/ clearly states that
pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org
so that my call to python -m ensurepip --default-pip did in fact result in No module named ensurepip (as I am not using >=2.7.9).
Yet I was finally able to get pip running: instead of using the latest get-pip.py at https://bootstrap.pypa.io/get-pip.py I used https://bootstrap.pypa.io/2.6/get-pip.py.
For future reference, and those who want to compare against any version of get-pip.py in https://github.com/pypa/get-pip:
29af88001263a19911c0911057cc192e ./get-pip.py did *not* work for me,
e4bd67ad4de5329bd4291e06ee3ba012 ./2.6/get-pip.py *did* work for me.
You may find it easier to install Python and Pip from the executable from python.org.
pip.pypa.io seems to make installing Python harder than it has to be. Maybe it has a special use case.
Edit:
I also recommend uninstalling the current version you have now so there are no conflicts.

Getting erros trying to install a new package for Python

I have spent hours trying to install a new package for Python (XlsxWriter) but Ican't figure out how to do it. (I am using Python 2.7.10)
I download the two files from here and copied them into my main Python directory:
https://pypi.python.org/pypi/XlsxWriter
In their documentation they recommended using
'pip install XlsxWriter' to install.
I followed the instructions to install pip from here (downloading file and running 'python get-pip.py'):
https://pip.pypa.io/en/latest/installing/#install-pip
That seemed to work but when I type 'pip install XlsxWriter' it still says "'pip' is not recognized as an internal or external command" e.t.c.
Also, as I had downloaded a tarball, I tried the line tar -zxvf XlsxWriter-0.7.7.tar.gz but it just says tar isn't a recognised command again.
If I load python in the command prompt by just typing 'python' and then try the above commands it just says invalid syntax
Where am I going wrong?
Sorry this is so simple but I have no one to ask in real life and have followed the instructions to install python packages in a few places but still can't get it to work.
try python -m pip install XlsxWriter
invoke it as a python module... Your path may not be properly set to just recognize pip
Add your python installation bin folder to your environment path
The problem is your pip installation. You have make pip work first:
http://pip.readthedocs.org/en/stable/installing/
Then you can do pip install XlsxWriter without downloading the package first.
Alternatively you can unpack the archive (tar -xvf XlsxWriter-0.7.7.tar.gz on Linux/Mac) and then do python setup.py install.

In a virtualenv, pip can see all of my site-packages when I use list, is this normal?

I thought that virtualenv was supposed to encapsulate and hide all of your packages that were already installed. But when I type
$sudo virtualenv -p /usr/bin/python3 testenv
$source ~/testenv/bin/activate
$sudo pip list
I get:
apt-xapian-index (0.45)
argparse (1.2.1)
chardet (2.0.1)
cmsplugin-filer (0.10)
colorama (0.2.5)
command-not-found (0.3)
debtagshw (0.1)
defer (1.0.6)
dirspec (13.10)
...and many more
Even with the --local parameter. Is virtualenv broken?
Also when I type: $ which pip I still get: /home/jelikraftuser/testenv/bin/pip Which seems correct.
Reading the answers in this post: pip installing in global site-packages instead of virtualenv
I found the suggestion to run pip directly with $sudo ~/testenv/bin/pip list and it actually worked, it only listed 2 packages. However when I run which pip it lists the pip in the virtualenv as being the one which would be run.
So I'm sort of lost at this point. Calling the pip list with the full path gives me the correct (small) list of two packages, and calling pip list without the full path gives me a giant list of packages, which is incorrect. So, where do I go from here?
How can I make it not recognise globally installed packages as being installed in the virtualenv when I run pip without the full path?
OKAY UPDATE! This is kinda interesting:
(testenv)$ pip --version
pip 1.5.6 from /home/jelikraftuser/testenv/lib/python3.4/site-packages (python 3.4)
(testenv)$ sudo pip --version
pip 1.5.4 from /usr/lib/python2.7/dist-packages (python 2.7)
When I run pip as sudo it runs one, and when i run it as non-sudo it runs a different pip. Why would it do that? And if I'm going to be installing a package, i'll be running it as sudo, so I need sudo to use the correct pip.
Second update:
Reading this stackoverflow:sudo changes PATH - why?
I found that on ubuntu you cannot change the path variable for sudo, but this still confuses me since it was working before... So I'm still confused. Insight anyone? Previously I could type sudo pip list in a virtualenv and get a near-empty list. Does it do the same for you?
EDIT 3: What else it does:
When I run sudo pip install --download-cache=~/.pip-cache -r piprequirements.txt
it says that everything is already installed but when I enter python I cannot import them, but when I run python as sudo I can import them. So superuser can see packages that are globally installed > but I need to use sudo to install packages > so I can't install packages that are already globally installed. Also when I try to run pip3 as sudo, it says sudo: pip3: command not found. So this is definately an issue with ubuntu and how the environment path changes when you run sudo. Is not everyone else running into this issue then? I'm sure lots of people are using ubuntu, no?

Categories