preparing the installation of a Python-development environment

Discussion of non-phpBB related topics with other phpBB.com users.
Forum rules
General Discussion is a bonus forum for discussion of non-phpBB related topics with other phpBB.com users. All site rules apply.
Locked
User avatar
apollodriver
Registered User
Posts: 53
Joined: Tue Jan 21, 2020 11:35 am

preparing the installation of a Python-development environment

Post by apollodriver »

hello dear phpBB experts,


well i have mused for many hours and made up my mind where to go with this article - it is not phpBB related but i want to do some things with my computer and i guess that here are many many experts. so this would be a great place for this question.

i am currently preparing my Asus Notebook for the installation of a Python-development environment. the prelimininary things i do are the following tests and here is what i have encountered. 

note: i am on Linux: 

Code: Select all

martin@MartinsMX-Rechner:~
$ python --version
Python 2.7.13
martin@MartinsMX-Rechner:~
$ uname -a
Linux MartinsMX-Rechner 4.19.0-5-amd64 #1 SMP Debian 4.19.37-2~mx17+1 (2019-05-15) x86_64 GNU/Linux
martin@MartinsMX-Rechner:~
$ 
well - i guess that i have to 
- renew the python version. this is pretty important!
- have a closer look at the MX-version ( - actual version is 19.1

then i should do the following:  

to setup pipenv to run and work with Python.

Code: Select all

cf. python-guide.org/dev/virtualenvs/
Make sure you’ve got Python & pip :: Before you go any further, make sure you have Python and that it’s available from your command line. You can check this by simply running:

Code: Select all

$ python --version
You should get some output like 3.6.2. If you do not have Python, please install the latest 3.x version from python.org or
 refer to the Installing Python section of this guide.
the question is: How do I setup pipenv to use Python 3.6 when my system does not have python 3.6?

Code: Select all

$ pipenv --python 2.7.1.3
Warning: python 2.7.1.3 was not found on your system…
You can specify specific versions of Python with:

Code: Select all

  $ pipenv --python path/to/python
i guess - that i either sensu python-guide.org/dev/virtualenvs/ can work on the issues: - either i can manually write the version i need in the according Pipfile:

Code: Select all

[requires]
python_version = "2.7.1.3"
Or i can install it on my system. But I guess we will need the version to be installed if we plan to actually run pipenv install.therefore i think that i should go ahead and use pyenv sensu: https://github.com/pyenv/pyenv. i think that i have to follow the installation instructions, then afterwards installing Python 2.7.1.3. is just a matter of

 

Code: Select all

pyenv install 2.7.1.3
Then i can set the order of preference with

Code: Select all

pyenv global system 2.7.1.3
Besides, if pyenv is available, pipenv will automatically use it to install the required version. From pipenv README: Automatically install required Pythons, if pyenv is available.
 
This does a user installation to prevent breaking any system-wide packages. If pipenv isn’t available in the shell after installation, you’ll need to add the user base’s binary directory to your PATH. On Linux and macOS you can find the user base binary directory by running python -m site --user-base and adding bin to the end. For example, this will typically

Code: Select all

 print ~/.local (with ~ expanded
to the absolute path to your home directory) so you’ll need to add

Code: Select all

~/.local/bin to your PATH. You can set your PATH permanently by modifying ~/.profile.
by the way: On Windows you can find the user base binary directory by running py -m site --user-site and replacing site-packages with Scripts.

For example, this could return C:\Users\Username\AppData\Roaming\Python36\site-packages so you would need to set your PATH to include C:\Users\Username\AppData\Roaming\Python36\Scripts. You can set your user PATH permanently in the Control Panel. You may need to log out for the PATH changes to take effect.
by the way: Well - i am on MX-Linux and i want to set up the environment on a linux-machine.


what do you say...?
Look forward to hear from you


have a great day

your appollodriver



User avatar
warmweer
Jr. Extension Validator
Posts: 4287
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: preparing the installation of a Python-development environment

Post by warmweer »

I don't see the point of this on a php (BB) dedicated board, especially since you're really requesting info on environment setup.
Surely there are sites dedicated to Python (setup) where experts can answer those questions.

User avatar
HiFiKabin
Community Team Member
Community Team Member
Posts: 4612
Joined: Wed May 14, 2014 9:10 am
Location: Swearing at the PC, UK
Name: James
Contact:

Re: preparing the installation of a Python-development environment

Post by HiFiKabin »

I totally agree with the above, You will be far better off posting on the python support board https://www.python.org/community/

As theres no discussion value I am locking

Locked

Return to “General Discussion”