Re: upgrade pip

2022-04-23 Thread Eryk Sun
On 4/22/22, Tola Oj  wrote:
> im trying to upgrade my pip so i can install openpyxl. i though i had
> successfully upgraded pip, and then I was trying to install openpyxl, but I
> was getting this:
>
> C:\Users\ojomo>"C:\Program Files\Python310\python.exe" -m pip install
> --upgrade
>
> [...]
>
> "C:\Users\ojomo\AppData\Roaming\Python\Python310\site-packages\pip\__main__.py",
> line 29, in 

You have pip installed for the current user, but Python is installed
for all users. I'd delete the package directory
"%AppData%\Python\Python310\site-packages\pip". Then run ensurepip and
upgrade from an administrator shell. This will install and update pip
for all users.

https://docs.python.org/3/library/ensurepip.html
-- 
https://mail.python.org/mailman/listinfo/python-list


upgrade pip

2022-04-22 Thread Tola Oj
im trying to upgrade my pip so i can install openpyxl. i though i had
successfully upgraded pip, and then I was trying to install openpyxl, but I
was getting this:

C:\Users\ojomo>"C:\Program Files\Python310\python.exe" -m pip install
--upgrade
Traceback (most recent call last):
  File "C:\Program Files\Python310\lib\runpy.py", line 196, in
_run_module_as_main
return _run_code(code, main_globals, None,
  File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
  File
"C:\Users\ojomo\AppData\Roaming\Python\Python310\site-packages\pip\__main__.py",
line 29, in 
from pip._internal.cli.main import main as _main
  File
"C:\Users\ojomo\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\main.py",
line 9, in 
from pip._internal.cli.autocompletion import autocomplete
  File
"C:\Users\ojomo\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\autocompletion.py",
line 10, in 
from pip._internal.cli.main_parser import create_main_parser
  File
"C:\Users\ojomo\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\main_parser.py",
line 8, in 
from pip._internal.cli import cmdoptions
  File
"C:\Users\ojomo\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\cmdoptions.py",
line 23, in 
from pip._internal.cli.parser import ConfigOptionParser
  File
"C:\Users\ojomo\AppData\Roaming\Python\Python310\site-packages\pip\_internal\cli\parser.py",
line 12, in 
from pip._internal.configuration import Configuration,
ConfigurationError
  File
"C:\Users\ojomo\AppData\Roaming\Python\Python310\site-packages\pip\_internal\configuration.py",
line 20, in 
from pip._internal.exceptions import (
  File
"C:\Users\ojomo\AppData\Roaming\Python\Python310\site-packages\pip\_internal\exceptions.py",
line 13, in 
from pip._vendor.requests.models import Request, Response
  File
"C:\Users\ojomo\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\requests\__init__.py",
line 43, in 
from pip._vendor import urllib3
ImportError: cannot import name 'urllib3' from 'pip._vendor'
(C:\Users\ojomo\AppData\Roaming\Python\Python310\site-packages\pip\_vendor\__init__.py)


and then I realised no matter what I type into the terminal (for example if
I'm trying to check what version pip is, or I'm to import another module),
it will print out this same specific lines of code.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: struggle to upgrade pip on visual studio code

2022-04-22 Thread Richard Damon

On 4/22/22 6:11 AM, Tola Oj wrote:

hello, i successfully installed openpyxl but it is saying this about my pip:

WARNING: You are using pip version 22.0.2; however, version 22.0.4 is
available.You should consider upgrading via the 'C:\Program
Files\Python310\python.exe -m pip install --upgrade pip' command.

And then when I try to upgrade using 'C:\Program Files\Python310\python.exe
-m pip install --upgrade pip command it says this:

C:\Program : The term 'C:\Program' is not recognized as the name of a

cmdlet, function, script file, or operable program. Check the spelling of

the name, or if a path was included, verify that the path is correct and

try again.
At line:1 char:1
+ C:\Program Files\Python310\python.exe -m pip install --upgrade pip+
~~
 + CategoryInfo  : ObjectNotFound: (C:\Program:String) [], Comma

ndNotFoundException
 + FullyQualifiedErrorId : CommandNotFoundException

please what do I do?


When a program name/path includes spaces, you need to put the whole name 
in quotes, like


"C:\Program Files\Python310\python.exe" -m pip install --upgrade

Now, if python is on your path (and 3.10 is the first python found), you 
should be able to simpify that to


python -m pip install --upgrade

--
Richard Damon

--
https://mail.python.org/mailman/listinfo/python-list


struggle to upgrade pip on visual studio code

2022-04-22 Thread Tola Oj
hello, i successfully installed openpyxl but it is saying this about my pip:

WARNING: You are using pip version 22.0.2; however, version 22.0.4 is
available.You should consider upgrading via the 'C:\Program
Files\Python310\python.exe -m pip install --upgrade pip' command.

And then when I try to upgrade using 'C:\Program Files\Python310\python.exe
-m pip install --upgrade pip command it says this:

C:\Program : The term 'C:\Program' is not recognized as the name of a

cmdlet, function, script file, or operable program. Check the spelling of

the name, or if a path was included, verify that the path is correct and

try again.
At line:1 char:1
+ C:\Program Files\Python310\python.exe -m pip install --upgrade pip+
~~
+ CategoryInfo  : ObjectNotFound: (C:\Program:String) [], Comma

   ndNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

please what do I do?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Option for venv to upgrade pip automatically?

2021-12-29 Thread Marco Sulla
Cool, thanks!

On Wed, 29 Dec 2021 at 07:10, Inada Naoki  wrote:
>
> You can use --upgrade-deps option. My alias is:
>
>   alias mkvenv='python3 -m venv --upgrade-deps --prompt . venv'
>
> On Wed, Dec 29, 2021 at 4:55 AM Marco Sulla
>  wrote:
> >
> > I think it's very boring that, after creating a venv, you have
> > immediately to do every time:
> >
> > pip install -U pip
> >
> > Can't venv have an option for doing this automatically or, better, a
> > config file where you can put commands that will be launched every
> > time after you create a venv?
> > --
> > https://mail.python.org/mailman/listinfo/python-list
>
>
>
> --
> Inada Naoki  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Option for venv to upgrade pip automatically?

2021-12-28 Thread Inada Naoki
You can use --upgrade-deps option. My alias is:

  alias mkvenv='python3 -m venv --upgrade-deps --prompt . venv'

On Wed, Dec 29, 2021 at 4:55 AM Marco Sulla
 wrote:
>
> I think it's very boring that, after creating a venv, you have
> immediately to do every time:
>
> pip install -U pip
>
> Can't venv have an option for doing this automatically or, better, a
> config file where you can put commands that will be launched every
> time after you create a venv?
> --
> https://mail.python.org/mailman/listinfo/python-list



-- 
Inada Naoki  
-- 
https://mail.python.org/mailman/listinfo/python-list


Option for venv to upgrade pip automatically?

2021-12-28 Thread Marco Sulla
I think it's very boring that, after creating a venv, you have
immediately to do every time:

pip install -U pip

Can't venv have an option for doing this automatically or, better, a
config file where you can put commands that will be launched every
time after you create a venv?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Failed to upgrade pip in fresh 2.7 install

2015-09-26 Thread eryksun
On 9/26/15, Zachary Ware  wrote:
> On Sat, Sep 26, 2015 at 1:13 PM,   wrote:
>> After a fresh install of Python 2.7 32-bit and 64-bit, upgrading pip
>> using pip fails. Am I doing this incorrectly? Any suggestions?
>
> This is a limitation of Windows: you can't replace the executable that
> you're currently running.

A memory-mapped file can be renamed, so replacing the executable is
doable. The new name has to be on the same volume. That's doable. The
problem is that Windows doesn't allow deleting the file. Maybe pip
could spawn a clean-up script to which it pipes the list of renamed
files. The script waits for pip to exit and then tries to remove the
files.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Failed to upgrade pip in fresh 2.7 install

2015-09-26 Thread Joel Goldstick
On Sat, Sep 26, 2015 at 6:24 PM,  wrote:

> Joel, no need for elevated (Administrator) execution. I did need to
> follow Zachary's suggestion and it worked well.
>

Good result.  I'm not up on windows for many years


-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Failed to upgrade pip in fresh 2.7 install

2015-09-26 Thread paul . hermeneutic
Joel, no need for elevated (Administrator) execution. I did need to
follow Zachary's suggestion and it worked well.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Failed to upgrade pip in fresh 2.7 install

2015-09-26 Thread Zachary Ware
On Sat, Sep 26, 2015 at 1:13 PM,   wrote:
> After a fresh install of Python 2.7 32-bit and 64-bit, upgrading pip
> using pip fails. Am I doing this incorrectly? Any suggestions?

This is a limitation of Windows: you can't replace the executable that
you're currently running.  To work around this, do "python -m pip
install --upgrade pip" instead.  If you have the Python Launcher for
Windows installed (included with Python 3.3+), you can use in place of
'python' in that command, and be very sure about which python's pip is
being upgraded.

-- 
Zach
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Failed to upgrade pip in fresh 2.7 install

2015-09-26 Thread Joel Goldstick
On Sat, Sep 26, 2015 at 2:52 PM, Joel Goldstick 
wrote:

> sudo pip ... etc
>
> On Sat, Sep 26, 2015 at 2:13 PM,  wrote:
>
>> After a fresh install of Python 2.7 32-bit and 64-bit, upgrading pip
>> using pip fails. Am I doing this incorrectly? Any suggestions?
>>
>> C:\Python27-32\Scripts>pip install --upgrade pip
>> You are using pip version 7.0.1, however version 7.1.2 is available.
>> You should consider upgrading via the 'pip install --upgrade pip' command.
>> Collecting pip
>>   Using cached pip-7.1.2-py2.py3-none-any.whl
>> Installing collected packages: pip
>>   Found existing installation: pip 7.0.1
>> Uninstalling pip-7.0.1:
>>   Successfully uninstalled pip-7.0.1
>> Exception:
>> Traceback (most recent call last):
>>   File "C:\Python27-32\lib\site-packages\pip\basecommand.py", line 223,
>> in main
>> logger.debug('Exception information:', exc_info=True)
>>   File "C:\Python27-32\lib\site-packages\pip\commands\install.py",
>> line 297, in run
>> wb = WheelBuilder(
>>   File "C:\Python27-32\lib\site-packages\pip\req\req_set.py", line
>> 633, in install
>> for requirement in to_install:
>>   File "C:\Python27-32\lib\site-packages\pip\req\req_install.py", line
>> 734, in commit_uninstall
>>
>>   File "C:\Python27-32\lib\site-packages\pip\req\req_uninstall.py",
>> line 153, in commit
>> self.save_dir = None
>>   File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
>> line 49, in wrapped_f
>> return Retrying(*dargs, **dkw).call(f, *args, **kw)
>>   File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
>> line 212, in call
>> raise attempt.get()
>>   File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
>> line 247, in get
>> six.reraise(self.value[0], self.value[1], self.value[2])
>>   File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
>> line 200, in call
>> attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
>>   File "C:\Python27-32\lib\site-packages\pip\utils\__init__.py", line
>> 89, in rmtree
>> shutil.rmtree(dir, ignore_errors=ignore_errors,
>>   File "C:\Python27-32\lib\shutil.py", line 247, in rmtree
>> rmtree(fullname, ignore_errors, onerror)
>>   File "C:\Python27-32\lib\shutil.py", line 247, in rmtree
>> rmtree(fullname, ignore_errors, onerror)
>>   File "C:\Python27-32\lib\shutil.py", line 252, in rmtree
>> onerror(os.remove, fullname, sys.exc_info())
>>   File "C:\Python27-32\lib\site-packages\pip\utils\__init__.py", line
>> 101, in rmtree_errorhandler
>> # use the original function to repeat the operation
>> WindowsError: [Error 5] Access is denied:
>>
>> 'c:\\users\\pwatson\\appdata\\local\\temp\\pip-4nt07e-uninstall\\python27-32\\scripts\\pip.exe'
>> --
>> https://mail.python.org/mailman/listinfo/python-list
>>
>
>
> sorry, you have windows.  Do you need to be admin?

>
> --
> Joel Goldstick
> http://joelgoldstick.com
>



-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Failed to upgrade pip in fresh 2.7 install

2015-09-26 Thread Joel Goldstick
sudo pip ... etc

On Sat, Sep 26, 2015 at 2:13 PM,  wrote:

> After a fresh install of Python 2.7 32-bit and 64-bit, upgrading pip
> using pip fails. Am I doing this incorrectly? Any suggestions?
>
> C:\Python27-32\Scripts>pip install --upgrade pip
> You are using pip version 7.0.1, however version 7.1.2 is available.
> You should consider upgrading via the 'pip install --upgrade pip' command.
> Collecting pip
>   Using cached pip-7.1.2-py2.py3-none-any.whl
> Installing collected packages: pip
>   Found existing installation: pip 7.0.1
> Uninstalling pip-7.0.1:
>   Successfully uninstalled pip-7.0.1
> Exception:
> Traceback (most recent call last):
>   File "C:\Python27-32\lib\site-packages\pip\basecommand.py", line 223, in
> main
> logger.debug('Exception information:', exc_info=True)
>   File "C:\Python27-32\lib\site-packages\pip\commands\install.py",
> line 297, in run
> wb = WheelBuilder(
>   File "C:\Python27-32\lib\site-packages\pip\req\req_set.py", line
> 633, in install
> for requirement in to_install:
>   File "C:\Python27-32\lib\site-packages\pip\req\req_install.py", line
> 734, in commit_uninstall
>
>   File "C:\Python27-32\lib\site-packages\pip\req\req_uninstall.py",
> line 153, in commit
> self.save_dir = None
>   File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
> line 49, in wrapped_f
> return Retrying(*dargs, **dkw).call(f, *args, **kw)
>   File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
> line 212, in call
> raise attempt.get()
>   File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
> line 247, in get
> six.reraise(self.value[0], self.value[1], self.value[2])
>   File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
> line 200, in call
> attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
>   File "C:\Python27-32\lib\site-packages\pip\utils\__init__.py", line
> 89, in rmtree
> shutil.rmtree(dir, ignore_errors=ignore_errors,
>   File "C:\Python27-32\lib\shutil.py", line 247, in rmtree
> rmtree(fullname, ignore_errors, onerror)
>   File "C:\Python27-32\lib\shutil.py", line 247, in rmtree
> rmtree(fullname, ignore_errors, onerror)
>   File "C:\Python27-32\lib\shutil.py", line 252, in rmtree
> onerror(os.remove, fullname, sys.exc_info())
>   File "C:\Python27-32\lib\site-packages\pip\utils\__init__.py", line
> 101, in rmtree_errorhandler
> # use the original function to repeat the operation
> WindowsError: [Error 5] Access is denied:
>
> 'c:\\users\\pwatson\\appdata\\local\\temp\\pip-4nt07e-uninstall\\python27-32\\scripts\\pip.exe'
> --
> https://mail.python.org/mailman/listinfo/python-list
>



-- 
Joel Goldstick
http://joelgoldstick.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Failed to upgrade pip in fresh 2.7 install

2015-09-26 Thread paul . hermeneutic
After a fresh install of Python 2.7 32-bit and 64-bit, upgrading pip
using pip fails. Am I doing this incorrectly? Any suggestions?

C:\Python27-32\Scripts>pip install --upgrade pip
You are using pip version 7.0.1, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pip
  Using cached pip-7.1.2-py2.py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 7.0.1
Uninstalling pip-7.0.1:
  Successfully uninstalled pip-7.0.1
Exception:
Traceback (most recent call last):
  File "C:\Python27-32\lib\site-packages\pip\basecommand.py", line 223, in main
logger.debug('Exception information:', exc_info=True)
  File "C:\Python27-32\lib\site-packages\pip\commands\install.py",
line 297, in run
wb = WheelBuilder(
  File "C:\Python27-32\lib\site-packages\pip\req\req_set.py", line
633, in install
for requirement in to_install:
  File "C:\Python27-32\lib\site-packages\pip\req\req_install.py", line
734, in commit_uninstall

  File "C:\Python27-32\lib\site-packages\pip\req\req_uninstall.py",
line 153, in commit
self.save_dir = None
  File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
line 49, in wrapped_f
return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
line 212, in call
raise attempt.get()
  File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
line 247, in get
six.reraise(self.value[0], self.value[1], self.value[2])
  File "C:\Python27-32\lib\site-packages\pip\_vendor\retrying.py",
line 200, in call
attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "C:\Python27-32\lib\site-packages\pip\utils\__init__.py", line
89, in rmtree
shutil.rmtree(dir, ignore_errors=ignore_errors,
  File "C:\Python27-32\lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
  File "C:\Python27-32\lib\shutil.py", line 247, in rmtree
rmtree(fullname, ignore_errors, onerror)
  File "C:\Python27-32\lib\shutil.py", line 252, in rmtree
onerror(os.remove, fullname, sys.exc_info())
  File "C:\Python27-32\lib\site-packages\pip\utils\__init__.py", line
101, in rmtree_errorhandler
# use the original function to repeat the operation
WindowsError: [Error 5] Access is denied:
'c:\\users\\pwatson\\appdata\\local\\temp\\pip-4nt07e-uninstall\\python27-32\\scripts\\pip.exe'
-- 
https://mail.python.org/mailman/listinfo/python-list