Using pip with embedded Python is not supported.
I think this makes using embedded Python pointless for most use cases.
Thus this should be discussed with the CPython maintainers.
Let me explain a little bit about the background:
I’ve been using Python for several background programs in commercial applications for ~ 20 years.
These programs are running on servers «on-premise» in our customers’ environments.
In many cases, several different variations of such programs are running on the machine, a typical case may be running the same kind of programs for test, integration and production environment.
Independence requirement:
It must be assured changes in one environment do not change the behavior of a different environment, e.g. if I install a new release of program A in the test environment, this must not effect the production environment.
The classic Python installation required admin rights and installed a pythonXX.dll
inside the windowssystem32
directory.
So it was not possible with this kind of installation to install e.g. Python 2.4.1 and Python 2.4.3 in parallel while satisfying the independence requirement. It doesn’t matter if «install for all users» or «install just for me» is used.
So we tried a different kind of installation. Newer Python releases allowed the installer program to run headless and to specify an installation directory. This worked fine with Python 2.6 and Python 2.7. We could install different Python releases independently in different directories, without modifying the Windows registry or creating files inside windowssystem32
. We just had to set some environment variables for the program and everything was fine.
When we switched to Python 3.1 (IIRC) this didn’t work anymore.
I don’t remember what exactly the reason was, but I think it was something about the py launcher. Anyway, it seemed impossible to use different python releases really independently.
We considered using virtual environments, but at that time, this didn’t work well on Windows (everything was changing constantly, virtualenv vs venv, …).
We then found a solution by choosing the embeddable ZIP distribution.
Our programs require ~ 10 3rdParty packages, not all of them are pure Python.
While it is certainly possible to install these packages without pip, that is a very error-prone process.
But once pip is installed, installing other packages is a snap. So the «fiddling around» was only needed once to install pip, instead of once for each package.
This has become more and more important during the last years, because updating packages to newer releases is needed much more frequently nowadays, with everyone being concerned about security,
A bit provocantly, one could say:
Python without pip is useless nowadays.
With pip being available, our clients can install fixes for known security issues in the 3rd Party packages themselves, if they like.
And we can create little helper tools for this task.
Without pip, as soon as a security issue is found in one of the 3rdParty packages and a client wants it to be fixed, they can only tell us about it and ask for a new program release.
Then we would have to build and test such a new release and provide it for download; the client would have to install it.
This results in unnecessary work for us and for our clients and — more important — in a much longer reaction time before a security issue can be fixed in our clients’ environment.
Another important problem arises then: Our clients do not want a new release of our software, because that might change behavior. According to their compliance rule, they’d have to test the whole new software then, or even to run an expensive manual software certification process. They just want the security fix, nothing more and nothing less.
If we have to supply a new release of our software just for security fixes in 3rdParty packages, then in fact this is going to be a mess of releases, because the bundled software would be unique for every customer, resulting in several releases per day.
Thus I think, Python Embeddable Zip
without pip
is useless for real-world development for Python Applications as described in «Using Python for Windows».
The only remaining use-case for Embeddable Python would be for using Python as a scripting language (such as in Blender).
Sep-16-2019, 02:10 PM
(This post was last modified: Sep-16-2019, 02:42 PM by metulburr.)
hello dear experts,
well i have no idea why the python things do not work here.
the pc. Win 7
the idea: i want to install the newest python and some additional things.
Python: command “python -m pip install —upgrade pip” doesn’t work
I want to upgrade my pip, but if I type in «python -m pip install —upgrade pip», then my command shell says «cannot find ‘python'». Python is already installed and my command shell can’t detect the command «python», though.
Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. Alle Rechte vorbehalten. C:UsersKasper>pip install esptool Collecting esptool Downloading https://files.pythonhosted.org/packages/6c/bf/578443af2270ebeff78f dfd30cef3a02433cc63b34a912936653a48526dd/esptool-2.7.tar.gz (83kB) 100% |████████████████████████████████| 92kB 1.7MB/s Collecting pyserial>=3.0 (from esptool) Downloading https://files.pythonhosted.org/packages/0d/e4/2a744dd9e3be04a0c090 7414e2a01a7c88bb3915cbe3c8cc06e209f59c30/pyserial-3.4-py2.py3-none-any.whl (193k B)/> 100% |████████████████████████████████| 194kB 4.3MB/s Collecting pyaes (from esptool) Downloading https://files.pythonhosted.org/packages/44/66/2c17bae31c9066137957 11fc78045c285048168919ace2220daa372c7d72/pyaes-1.6.1.tar.gz Collecting ecdsa (from esptool) Downloading https://files.pythonhosted.org/packages/23/a8/8aa68e70959e1287da91 54e5164bb8bd5dd7025e41ae54e8d177b8d165c9/ecdsa-0.13.2-py2.py3-none-any.whl (59kB ) 100% |████████████████████████████████| 61kB 7.7MB/s Installing collected packages: pyserial, pyaes, ecdsa, esptool Could not install packages due to an EnvironmentError: [WinError 5] Zugriff verw eigert: 'c:\program files\python37\Lib\site-packages\pyserial-3.4.dist-info ' Consider using the `--user` option or check the permissions. You are using pip version 10.0.1, however version 19.2.3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' comm and. C:UsersKasper>pip install wxPython Collecting wxPython Downloading https://files.pythonhosted.org/packages/d0/8e/2c72bc3624e5cee50aa9 4f8ae8756bc1c3aec96e8d456b6aa1242e92e9e8/wxPython-4.0.6-cp37-cp37m-win_amd64.whl (22.9MB) 100% |████████████████████████████████| 22.9MB 1.4MB/s Collecting numpy (from wxPython) Downloading https://files.pythonhosted.org/packages/bd/51/7df1a3858ff0465f760b 482514f1292836f8be08d84aba411b48dda72fa9/numpy-1.17.2-cp37-cp37m-win_amd64.whl ( 12.8MB) 100% |████████████████████████████████| 12.8MB 2.5MB/s Requirement already satisfied: six in c:userskasperappdataroamingpythonpyt hon37site-packages (from wxPython) (1.12.0) Collecting pillow (from wxPython) Downloading https://files.pythonhosted.org/packages/ae/96/6f83deebfcd20a5d4ad3 5e4e989814a16559d8715741457e670aae1a5a09/Pillow-6.1.0-cp37-cp37m-win_amd64.whl ( 2.0MB) 100% |████████████████████████████████| 2.0MB 6.0MB/s Installing collected packages: numpy, pillow, wxPython Could not install packages due to an EnvironmentError: [WinError 5] Zugriff verw eigert: 'c:\program files\python37\Lib\site-packages\numpy' Consider using the `--user` option or check the permissions. You are using pip version 10.0.1, however version 19.2.3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' comm and. C:UsersKasper> -m pip install wxpython Der Befehl "-m" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:UsersKasper> m pip install wxpython Der Befehl "m" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:UsersKasper> pip3 install --upgrade pip ERROR: To modify pip, please run the following command: c:program filespython37python.exe -m pip install --upgrade pip You are using pip version 10.0.1, however version 19.2.3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' comm and. C:UsersKasper>
well i have no glue whats going on here.
Posts: 5,147
Threads: 395
Joined: Sep 2016
Reputation:
170
Sep-16-2019, 02:41 PM
(This post was last modified: Sep-16-2019, 02:41 PM by metulburr.)
it says in the last error message to run this command in which you never did
c:program filespython37python.exe -m pip install --upgrade pip
then run in the command console this to verify you have the new version
pip -V
or full path equivalent
c:program filespython37python.exe -m pip -V
(Sep-16-2019, 02:10 PM)apollo Wrote: I want to upgrade my pip, but if I type in «python -m pip install —upgrade pip», then my command shell says «cannot find ‘python'»
When you installed python did you make sure the box was checked for setting python to the PATH? If not then python and pip will not be recognized unless you use the full path (As the upgrade command i shown agove).
Posts: 6,572
Threads: 116
Joined: Sep 2016
Reputation:
487
Sep-16-2019, 03:11 PM
(This post was last modified: Sep-16-2019, 03:14 PM by snippsat.)
Did you read my answer in your lasted thread?
Quote:[WinError 5] check the permissions
Run cmd as administrator
Again look at Python 3.6/3.7 and pip installation under Windows,it should take short time to fix this.
Then it work like this from any folder,always.
# Upgrade C:code λ python -m pip install --upgrade pip Collecting pip Downloading ...... |████████████████████████████████| 1.4MB 2.2MB/s Installing collected packages: pip Found existing installation: pip 19.2.1 Uninstalling pip-19.2.1: Successfully uninstalled pip-19.2.1 Successfully installed pip-19.2.3 # Test C:code λ pip -V pip 19.2.3 from c:python37libsite-packagespip (python 3.7)
При использовании PIP я получаю следующую ошибку: либо устанавливать новые пакеты, либо даже самому апдейт самому себе до последней версии. Я запускаю pip на машине с Windows 8.1 с Python 3.4.
В сообщении говорится, что у меня нет административных прав на файлы (моя учетная запись является учетной записью администратора).
Я был бы признателен за любые мысли о том, как решить эту проблему, поскольку это мешает установке пакетов и продвижению с помощью Python.
Сообщение об ошибке:
Installing collected packages: pip
Found existing installation: pip 6.0.8
Uninstalling pip-6.0.8:
Removing file or directory c:program files (x86)pythonpython34libsite-packagespip-6.0.8.dist-infodescription.rst
Cleaning up...
Exception:
Traceback (most recent call last):
File "C:Program Files (x86)PythonPython34libshutil.py", line 523, in move
os.rename(src, real_dst)
PermissionError: [WinError 5] Access is denied: 'c:\program files (x86)\python\python34\lib\site-packages\pip-6.0.8.dist-info\description.rst' -> 'C:\Users\User\AppData\Local\Temp\pip-uze_sc4k-uninstall\program files (x86)\python\python34\lib\site-packages\pip-6.0.8.dist-info\description.rst'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:Program Files (x86)PythonPython34libsite-packagespipbasecommand.py", line 232, in main
status = self.run(options, args)
File "C:Program Files (x86)PythonPython34libsite-packagespipcommandsinstall.py", line 347, in run
root=options.root_path,
File "C:Program Files (x86)PythonPython34libsite-packagespipreqreq_set.py", line 543, in install
requirement.uninstall(auto_confirm=True)
File "C:Program Files (x86)PythonPython34libsite-packagespipreqreq_install.py", line 667, in uninstall
paths_to_remove.remove(auto_confirm)
File "C:Program Files (x86)PythonPython34libsite-packagespipreqreq_uninstall.py", line 126, in remove
renames(path, new_path)
File "C:Program Files (x86)PythonPython34libsite-packagespiputils__init__.py", line 316, in renames
shutil.move(old, new)
File "C:Program Files (x86)PythonPython34libshutil.py", line 536, in move
os.unlink(src)
PermissionError: [WinError 5] Access is denied: 'c:\program files (x86)\python\python34\lib\site-packages\pip-6.0.8.dist-info\description.rst'