Python Forum
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I install Python?
#1
For the life of me, I cannot figure out how to install Python and get going.

Environment: Windows 10 Pro

I downloaded and unzipped: python-3.7.2.post1-embed-amd64.zip
from: https://www.python.org/ftp/python/3.7.2/...-amd64.zip

I did not download any .exe installer, only a fool would use an installer.

--
I added the path where I unzipped it to my PATH (.bash_profile am using cygwin on Windows). I did not modify my Windows path, only a fool would do that.

I would use Linux (not Windows 10 Pro), but am forced to at work.
--
So now I have python installed,

Quote:$python -V
Python 3.7.2

---
Apparently I need to also install pip to get anything done. I search and find this statement:
Quote:https://docs.python-guide.org/starting/i...l3-windows
All supported versions of Python 3 include pip, so just make sure it’s up to date:

python -m pip install -U pip

--
That statement is false, the .zip file did not contain pip. So I search some more and am instructed to type:
Quote:$python get-pip.py

and so I do: and get:
Quote:Collecting pip
Downloading https://files.pythonhosted.org/packages/...ne-any.whl (1.4MB)
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/...ne-any.whl (575kB)
Collecting wheel
Downloading https://files.pythonhosted.org/packages/...ne-any.whl
Installing collected packages: pip, setuptools, wheel
The script wheel.exe is installed in 'H:\apps\python\3.7.2\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-19.0.1 setuptools-40.8.0 wheel-0.32.3

--
I then add pip.exe to my .bash_profile path, not modifying my Windows path.

--
And so now I run:
Quote:python -m pip install -U pip

and I get:
Quote:H:\apps\python\3.7.2\python.exe: No module named pip

What the ****?

That does not look right. Would you expect that I get that?

What am I doing wrong here?

---
I type:
Quote:$pip -V

and I get:
Quote:Traceback (most recent call last):
File "D:\obj\Windows-Release\37amd64_Release\msi_python\zip_amd64\runpy.py", line 193, in _run_module_as_main
File "D:\obj\Windows-Release\37amd64_Release\msi_python\zip_amd64\runpy.py", line 85, in _run_code
File "H:\apps\python\3.7.2\Scripts\pip.exe\__main__.py", line 5, in <module>
ModuleNotFoundError: No module named 'pip'


What the ****?

Why is it telling me something about my D:\ drive and a path D:\obj, that I know nothing about?
I installed python, the .zip file under H:\apps\python\3.7.2\python.exe

I don't know what the hell is going on here.

I can't pip install or pip upgrade anything, and have no idea why it is talking about my D:\ drive or if I even have a D:\ drive.

CONTENT REMOVED

I just want things to work without any grief, friction or static.

I should be able to download a .zip file, put the .exe in my path and start coding. I should not have to install pip, if it's so very necessary for using Python. I don't know why it's missing in the .zip file, I don't know why it does not work. What is messed up here?
Reply
#2
Long story short - fool or not, get the installer and you will not have problems.
Follow our tutorial https://python-forum.io/Thread-Basic-Par...er-Windows
Of course, as an alternative you can always build from source...


Now the long story. The zip bundle has different purpose:
Quote:here are redistributable zip files containing the Windows builds, making it easy to redistribute Python as part of another software package. Please see the documentation regarding Embedded Distribution for more information.

Check also the link to docs provided above - there is more information, but the essentials:

Quote:The embedded distribution is a ZIP file containing a minimal Python environment. It is intended for acting as part of another application, rather than being directly accessed by end-users.

When extracted, the embedded distribution is (almost) fully isolated from the user’s system, including environment variables, system registry settings, and installed packages. The standard library is included as pre-compiled and optimized .pyc files in a ZIP, and python3.dll, python37.dll, python.exe and pythonw.exe are all provided. Tcl/tk (including all dependants, such as Idle), pip and the Python documentation are not included.

Note

The embedded distribution does not include the Microsoft C Runtime and it is the responsibility of the application installer to provide this. The runtime may have already been installed on a user’s system previously or automatically via Windows Update, and can be detected by finding ucrtbase.dll in the system directory.

Third-party packages should be installed by the application installer alongside the embedded distribution. Using pip to manage dependencies as for a regular Python installation is not supported with this distribution, though with some care it may be possible to include and use pip for automatic updates. In general, third-party packages should be treated as part of the application (“vendoring”) so that the developer can ensure compatibility with newer versions before providing updates to users.




On a side note, even a fool would read the docs when don't know what they are doing.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
I don't want to use an installer for various reasons.

I don't want it splatting files all over my disk drive in places I don't know. Using an installer does not make it portable. I don't want my registry modified.

I don't want my Windows path modified.

When installers are used, you can't uninstall the software. If you go to Windows application, and uninstall something that has been installed by an installer, it will not clean up everything. It leaves residue and crap that always comes back and jacks up things later. If you have been in this business long enough, you would be wise enough to know to never use an installer for anything ever, for any reason.

I want my Windows box to look as clean as the day it was installed, using portable apps if I can. If a company does not provide a portable app or a .zip file to install their software, I find something else.

I don't want files splatted all over or anything modified anywhere. People who write installers never get it right. Installers jack up my system.

I want to unzip a .zip file, put the directory where the .exe is located in my path, and boom, I am done with it.

Using this method lets me very easily switch versions. Using the various version switchers out there are problematic. I would rather change an environment variable to switch versions of python used, or use virtualenv.

If Python comes in a .zip format, then I should be able to use and run that.

If it does not work in .zip format I will switch languages, I'm tired of Python already with the 2.x 3.x mess.

It's been a nightmare, and any supposed time savings on language conciseness over other languages has been lost with library compatibility issues between 2.x and 3.x. I would rather write three lines of code, where it would take Python only three characters, if using the language the requires writing three lines of code meant that I would not have other library and dependency issues that I do right now with Python.

With other languages I have a choice of package managers. With some, there is no installation of a dependency, I only need to declare a library as a dependency in the build file and I'm done. The build system takes care of it, and things do not get jacked up when I upgrade the language version. This is a tangent. Right now I just want to get pip working, that's it, with no error messages that make no sense.

It's a big fat mess and I have lost weeks out of my life because of this with inherited Python code bases dumped on me, that I would just simply rather toss it in the garbage, and look at another language at this point.
Reply
#4
I update my answer that you can always build from source...

(Feb-06-2019, 09:18 AM)devlocalca Wrote: If Python comes in a .zip format, then I should be able to use and run that.
(Feb-06-2019, 09:18 AM)devlocalca Wrote: I want to unzip a .zip file, put the directory where the .exe is located in my path, and boom, I am done with it.

yes, you can use it, but there are limitations and you should be aware of them.
at the end it comes to compromises. Or on extreme, if you are not satisfied, you can just find and use another programming language
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#5
> find and use another programming language

Best advice yet, it has crossed my mind daily for many months now. Peak Python was long ago, time to jump off this crap wagon.
Reply
#6
(Feb-06-2019, 09:23 AM)devlocalca Wrote: It's been a nightmare, and any supposed time savings on language conciseness over other languages has been lost with library compatibility issues between 2.x and 3.x.

python 2 supports ends 01/01/2020. It's long time that you/your company should have migrated to python3. There is no compatibility issue for a long, long time - almost any external package that you may use want to use is python3 compatible. If it is not - probably you don't want to use it anyways. it's certainly long dead and not maintained.

(Feb-06-2019, 09:23 AM)devlocalca Wrote: With other languages I have a choice of package managers. With some, there is no installation of a dependency, I only need to declare a library as a dependency in the build file and I'm done. The build system takes care of it, and things do not get jacked up when I upgrade the language version. This is a tangent. Right now I just want to get pip working, that's it, with no error messages that make no sense.

you have pip, but you don't want to use it :-) don't blame python for your choices.

(Feb-06-2019, 09:30 AM)devlocalca Wrote: Peak Python was long ago
Maybe you should do reality check about that :-)

https://www.tiobe.com/tiobe-index/
https://hackernoon.com/top-3-most-popula...b4a7354e06
http://pypl.github.io/PYPL.html
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#7
If you are really uptight about installing, you can just use https://www.pythonanywhere.com/
Recommended Tutorials:
Reply
#8
The Python installer does not even work. Great suggestion.

[CONTENT REMOVED]

I downloaded and used the [CONTENT REMOVED] installer, and then I ran

Quote:$python -m pip install --upgrade pip

It gave me a great suggestion, that I should run
Quote:python -m pip install --upgrade pip

Brilliant. faking Python script kiddie losers.
Quote:bootstrap/ $python -m pip install --upgrade pip
Collecting pip
Using cached https://files.pythonhosted.org/packages/...ne-any.whl
Installing collected packages: pip
Found existing installation: pip 18.1
Uninstalling pip-18.1:
Successfully uninstalled pip-18.1
Rolling back uninstall of pip
Exception:
Traceback (most recent call last):
File "H:\apps\python\3.7.2\lib\site-packages\pip\_internal\cli\base_command.py", line 143, in main
status = self.run(options, args)
File "H:\apps\python\3.7.2\lib\site-packages\pip\_internal\commands\install.py", line 366, in run
use_user_site=options.use_user_site,
File "H:\apps\python\3.7.2\lib\site-packages\pip\_internal\req\__init__.py", line 49, in install_given_reqs
**kwargs
File "H:\apps\python\3.7.2\lib\site-packages\pip\_internal\req\req_install.py", line 760, in install
use_user_site=use_user_site, pycompile=pycompile,
File "H:\apps\python\3.7.2\lib\site-packages\pip\_internal\req\req_install.py", line 382, in move_wheel_files
warn_script_location=warn_script_location,
File "H:\apps\python\3.7.2\lib\site-packages\pip\_internal\wheel.py", line 215, in move_wheel_files
prefix=prefix,
File "H:\apps\python\3.7.2\lib\site-packages\pip\_internal\locations.py", line 165, in distutils_scheme
i.finalize_options()
File "H:\apps\python\3.7.2\lib\distutils\command\install.py", line 346, in finalize_options
'userbase', 'usersite')
File "H:\apps\python\3.7.2\lib\distutils\command\install.py", line 487, in convert_paths
setattr(self, attr, convert_path(getattr(self, attr)))
File "H:\apps\python\3.7.2\lib\distutils\util.py", line 110, in convert_path
raise ValueError("path '%s' cannot be absolute" % pathname)
ValueError: path '/h/home/<user>/appdata\Python' cannot be absolute
You are using pip version 18.1, however version 19.0.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

Why this line?
Quote:ValueError: path '/h/home/<user>/appdata\Python' cannot be absolute

What's that got to do with anything at all? I don't want anything to do with /h/home/<user>, NADA!

[CONTENT REMOVED]

User has been warned for this post. Reason: insulting and swearing
Reply
#9
Please, watch your language. With that attitude you will not get any more help from me, sorry
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#10
Insulting people and swearing will not get you help. Consider this your first and final warning. The next time you will be banned. Read through the rules. If you continue to post this way we will be happy to have you move along to a different language; to a different community. However you will not get far with any community speaking that way. I suggest to receive any more help from anyone, your next post be with an attitude change. Otherwise do not bother posting at this forum ever again.
https://python-forum.io/misc.php?action=help&hid=42
Recommended Tutorials:
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020