Ive got a mac, and as apart of the python curriculum we are supposed to download and open pipenv to learn how to use it. (pipenv being pip’s virtual environment settup ) I got pip downloaded and integrated with the terminal using the official python manual’s guide, but I cannot readily find out how to update the version of python the terminal operates with. now with os catalina when I open the python supporting receptacle within the terminal I see this:
WARNING: Python 2.7 is not recommended.
This version is included in macOS for compatibility with legacy software.
Future versions of macOS will not include Python 2.7.
Instead, it is recommended that you transition to using ‘python3’ from within Terminal.
this language would suggest it’s possible to integrate the python update into the terminal without using something like homebrew (yuck), and integration clearly can be accomplished (the following is from what I witnessed in the codecademy lesson):
I cannot use any of the tools the python update downloaded from the official site supplied to do so, and simple aliasing or prepending things to the PATH hasn’t worked for me so far. Also I know its possible to get (a potentially antiquated version of) pipenv alright without getting python 3 (3.8) integrated but at this point It has become my mission to get it integrated. How is it done? I am not really open to using something like homebrew, I would rather just create a linux environment if homebrew is the only option, but If my opinions of homebrew are baseless I’d be happy to hear it.
so to be explicit, I want to know how to make the terminal in mac use python 3.8 as it’s default so when I download python packages they are the ones for python 3.8, and so I can use the full extent of pythons abilities on my computer, as in applied onto my computer (as thats the only reason I can imagine python is pre-installed as apart of the shell and not exclusively coded in a coding app). or if this is not the right approach what the right approach is. **warning: I’ve sunk close to 30 hours into troubleshooting this, learning this stuff is a process If you don’t have prior experience with these things, and it seems unexpectedly hopeless.
not part of, your shell isn’t something that you install things into
you can install programs, and you can run programs from your shell, the shell and the programs are entirely separate things.
integrate is probably the wrong word here.
if you want a particular version of python to run when you type “python” then make sure that version is the first one found on your PATH
That is enlightening. this issue took some it’s shape from an instance when I opened a python file in visual studio code. As is protocol vsc then prompted me to install all relative dependencies [sic, possibly], which in this case was pip… and a linter? regardless no pipenv. so I clicked onto vsc’s extensions library / market and pipenv wasn’t there. so If I download pipenv from the web where does it go? how do I set it up right? do I need to get it to be recognized by the terminal so i can use pipenv commands, so I can control it and control what gets applied to the virtual environment?
also thank you for noticing the “appending” diction error. To my understanding "export PATH= " prepends, which is what I have done. I listed my .bash_profile additions in my reply to thepitycoder
If pipenv is expected to be installed then same as in a shell, such an executable would be expected to be found in PATH. This would be the PATH provided to vscode, not the one you have in your shell.
Where it goes depends on how you install it … since installing is putting it somewhere.
I know I place pipenv in an exact position when I download it, but to my knowledge prepending the correct path to python 3.8 onto PATH hasn’t worked to accomplish overriding the systems relevant default initiative. As far as I know, just because I know where pipenv is doesn’t mean I will be able to access it properly. but thanks for your contributions up to this point, they’ve all been furthering. I’m gonna regroup and attempt this independently.
There’s no concept of default.
The locations in PATH is searched in order. If it’s on there, and if it’s the first one matching, then that’s what you’ll get. If it didn’t “work” then it wasn’t done. For example, maybe the content of the file you’re editing isn’t executed, maybe because it never is, or because you’re not carrying out the step during which it gets executed (for example opening a new shell or even logging in and out)… It’s easy enough to verify by printing out the variable to see whether you’ve got the modification you made in it.
The Visual Studio Code Extensions library contains extensions for Visual Studio Code. That’s why it contained the Python extension, to make VSC understand the syntax of the language, and linters which allow VSC to help you with formatting.
pipenv is a Python package, not an extension for VSC…
Installing packages, even with Visual Studio Code installed, means using pip.