MX--Linux: preparing the installation of a Python-development environment. 


Recommended Posts

dear experts - hello to you, 

 

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 MX-Linux: 

 

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

- 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.

 

i read the following docs: cf. python-guide.org/dev/virtualenvs/

 

  Quote


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:

$ 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.

Expand  


the question is: How do I setup pipenv to use Python 3.6 when my system does not have python 3.6?

 

 

$ 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:

 

  $ 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:

[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 

 

pyenv install 2.7.1.3

Then i can set the order of preference with

pyenv global system 2.7.1.3

Besides, if pyenv is available, pipenv will automatically use it to install the required version. From the pipenv README: it says 

 

Automatically install required Pythons, if pyenv is available.

 

  Quote


This does a user installation to prevent breaking any system-wide packages. If pipenv isn’t available in your 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 print ~/.local (with ~ expanded to the absolute path to your home directory) so you’ll need to add ~/.local/bin to your PATH. You can set your PATH permanently by modifying ~/.profile.
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.

Expand  

 

 

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
 

 

 

 

Edited by tarifa

hi there 

 

guess that i have messed up the system a bit - on a fresh mx 19.1 

 

 

 

Passwort: 
root@mx:/home/martin# 
root@mx:/home/martin# wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo apt-key add -
OK
root@mx:/home/martin# 
root@mx:/home/martin# echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list
deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main
root@mx:/home/martin# 
root@mx:/home/martin# sudo apt update && sudo apt install codium
OK:1 http://deb.debian.org/debian buster-updates InRelease
Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease                                       
OK:3 http://ftp.halifax.rwth-aachen.de/mxlinux/packages/mx/repo buster InRelease                   
OK:4 http://deb.debian.org/debian buster InRelease                                                 
OK:5 http://deb.debian.org/debian-security buster/updates InRelease                                
OK:6 http://dl.google.com/linux/chrome/deb stable Release                                          
OK:7 https://packagecloud.io/AtomEditor/atom/any any InRelease                                     
Holen:9 https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs vscodium InRelease [3.828 B]
Holen:10 https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs vscodium/main amd64 Packages [603 B]
Es wurden 4.431 B in 5 s geholt (822 B/s).
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Aktualisierung für 49 Pakete verfügbar. Führen Sie »apt list --upgradable« aus, um sie anzuzeigen.
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
Die folgenden NEUEN Pakete werden installiert:
  codium
0 aktualisiert, 1 neu installiert, 0 zu entfernen und 49 nicht aktualisiert.
Es müssen 64,2 MB an Archiven heruntergeladen werden.
Nach dieser Operation werden 269 MB Plattenplatz zusätzlich benutzt.
Holen:1 https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs vscodium/main amd64 codium amd64 1.43.1-1584565098 [64,2 MB]
Es wurden 64,2 MB in 45 s geholt (1.436 kB/s).                                                     
Vormals nicht ausgewähltes Paket codium wird gewählt.
(Lese Datenbank ... 335525 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von .../codium_1.43.1-1584565098_amd64.deb ...
Entpacken von codium (1.43.1-1584565098) ...
codium (1.43.1-1584565098) wird eingerichtet ...
Trigger für mime-support (3.62) werden verarbeitet ...
Trigger für desktop-file-utils (0.23-4) werden verarbeitet ...
root@mx:/home/martin# 
root@mx:/home/martin# python3 -m venv scrapingvenv
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/home/martin/scrapingvenv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

root@mx:/home/martin# ^C
root@mx:/home/martin# 
root@mx:/home/martin# python3 -m venv scrapingvenv
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/home/martin/scrapingvenv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

root@mx:/home/martin# 


you see - exactly in the last part - i have issues: 


martin@mx:~
$ python3 -m venv scrapingvenv
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/home/martin/scrapingvenv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

martin@mx:~
$ 


hmm -  ineed to have further investigations...

  • 3 months later...

The process might go something like this:

 

$ cd ~
$ mkdir pythonroot
$ mkdir opt
$ mkdir app
$ cd opt
$ wget <python tarball>
$ tar -xvf <python tarball>
$ cd python-3.6
$ ./configure --prefix="$HOME"/pythonroot
$ make
$ make install
$ cd ~
$ cd app
$ virtualenv venv --python ~/pythonroot/bin/python
$ . venv/bin/activate
[venv]$ which python
/home/<user>/pythonroot/bin/python

  On 19/03/2020 at 18:11, tarifa said:

you see - exactly in the last part - i have issues: 

 

martin@mx:~
$ python3 -m venv scrapingvenv
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

Failing command: ['/home/martin/scrapingvenv/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']

martin@mx:~
$ 

 


hmm -  ineed to have further investigations...

Expand  

Perhaps I'm wrong, but that last part has it explained clearly. You need to write the following command:

sudo apt-get install python3-venv

Looking through all of your above posts here, I can't find one use of sudo before executing the command. Unless python3-venv is already installed on your machine?

 

With that said, I'm not an expert at Linux.

  • Like 1
  On 14/07/2020 at 07:36, Christopher Andreason said:

The process might go something like this:

 

$ cd ~
$ mkdir pythonroot
$ mkdir opt
$ mkdir app
$ cd opt
$ wget <python tarball>
$ tar -xvf <python tarball>
$ cd python-3.6
$ ./configure --prefix="$HOME"/pythonroot
$ make
$ make install
$ cd ~
$ cd app
$ virtualenv venv --python ~/pythonroot/bin/python
$ . venv/bin/activate
[venv]$ which python
/home/<user>/pythonroot/bin/python

Expand  

------------------------------------------------

suspect that python3 or python is not working properly and this is the cause of the problem

suspect that Node.js needs updating |which is needed for the codium to be used as intended

------------------------------------------------
Updating all packages (OS and other installed packages)
apt-get install update &&
apt-get install upgrade

Updating all packages (OS and other installed packages)
sudo apt update && sudo apt -y full-upgrade

------------------------------------------------
this works if python works normally?
------------------------------------------------

This will break scripts, but is exactly the way to change python. You should also rewrite the scripts to not assume python is 2.x. This will work regardless of the place where you call system or exec.

sudo mv / usr / bin / python / usr / bin / python2
sudo ln -s $ (which python3) / usr / bin / python

------------------------------------------------
python3 -m pip install --user --upgrade pip
python3 -m pip --version
python3 -m pip install --user virtualenv
python3 -m venv env

------------------------------------------------
sudo apt install python-pip
sudo apt install python3-venv python3-pip

this will work if python is working

------------------------------------------------

works for python3 and newer python versions

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py

------------------------------------------------

for old python2.6
curl https://bootstrap.pypa.io/2.6/get-pip.py -o get-pip.py
python get-pip.py
------------------------------------------------
which python
which python3

------------------------------------------------
Check the execution path of python3 where it has libraries
which python3
which python

------------------------------------------------
open bash_profile file and add an alias
nano ~ / .bash_profile
alias python = '/ usr / local / bin / python3' or alias python = '/ usr / bin / python3'

python --version
------------------------------------------------

do these commands work?

------------------------------------------------

does this command work

------------------------------------------------

Python 2
sudo apt install python-pip
------------------------------------------------

Python 3
sudo apt install python3-venv python3-pip

------------------------------------------------

 

Node.js LTS (12.x)

# As root
curl -sL https://rpm.nodesource.com/setup_lts.x | bash -
apt-get install -y nodejs

 

# No root privileges 
curl -sL https://rpm.nodesource.com/setup_lts.x | sudo bash -
sudo apt-get install -y nodejs

 

Node.js Current (14.x)

# As root
curl -sL https://rpm.nodesource.com/setup_current.x | bash -
apt-get install -y nodejs

 

# No root privileges 
curl -sL https://rpm.nodesource.com/setup_current.x | sudo bash -
sudo apt-get install -y nodejs
 

 

 

Edited by Christopher Andreason
missed to change some things

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • What is happening in the WNBA!    
    • RapidRAW 1.3.5 is out.
    • Microsoft Edge 139.0.3405.86 by Razvan Serea Microsoft Edge is a super fast and secure web browser from Microsoft. It works on almost any device, including PCs, iPhones and Androids. It keeps you safe online, protects your privacy, and lets you browse the web quickly. You can even use it on all your devices and keep your browsing history and favorites synced up. Built on the same technology as Chrome, Microsoft Edge has additional built-in features like Startup boost and Sleeping tabs, which boost your browsing experience with world class performance and speed that are optimized to work best with Windows. Microsoft Edge security and privacy features such as Microsoft Defender SmartScreen, Password Monitor, InPrivate search, and Kids Mode help keep you and your loved ones protected and secure online. Microsoft Edge has features to keep both you and your family protected. Enable content filters and access activity reports with your Microsoft Family Safety account and experience a kid-friendly web with Kids Mode. The new Microsoft Edge is now compatible with your favorite extensions, so it’s easy to personalize your browsing experience. Microsoft Edge 139.0.3405.86 changelog: Fixes Fixed an issue where MIP-protected PDF files from different sovereign cloud environments (including GCCH) failed to open and instead displayed the error message: “Need permissions. Contact the owner of the file to give you permissions.” Fixed an issue, which affected IE mode, including errors when displaying PDF files, running Java applets, and showing the Information Bar in IE mode. Improved reliability Fixed a browser crash that occurred on first launch when the BrowserSignin policy was enabled and configured to "Force (2) = Force users to sign-in to use the browser (all profiles)." Feature updates Open external links in another profile when recommended by external applications. When Microsoft Edge is set as the default browser to open external links from applications, Microsoft Edge must determine which profile to open the links. Users can control which profile to use through the “Default profile for external links” setting. Applications such as Microsoft Teams or Outlook can also recommend a profile for the links. Currently, the user setting is prioritized over application recommendations. With this feature, the application recommended profile is given priority, instead of the profile selected in the setting. Admins can control the availability of the feature using the EdgeOpenExternalLinksWithAppSpecifiedProfile policy. Note: This is a controlled feature rollout. If you don't see this feature, check back as we continue our rollout. Changes to Wallet in Microsoft Edge. Wallet is being phased out to support a streamlined experience within Microsoft Edge. This affects the Wallet feature in Settings and the Mini Wallet found by clicking the profile icon in the top banner. Users are directed to the new Passwords, Payment, and Personal Information management experience in Settings. Also, a new Password management experience is available in Settings. For more information, see Changes to Wallet in Microsoft Edge. Note: This is a controlled feature rollout. If you don't see this feature, check back as we continue our rollout. Introducing a new policy that can enable/disable Microsoft 365 Copilot Chat in Edge for Business from showing in the toolbar. Edge for Business now has a dedicated policy, Microsoft365CopilotChatIconEnabled, to enable and disable Copilot in Edge from showing in the Edge toolbar. When both this policy and HubsSidebarEnabled are configured, this policy takes precedence in determining whether Copilot appears in the toolbar. If this policy isn't configured and HubsSidebarEnabled is disabled, Copilot will remain hidden. In a future release, this policy is the sole control for managing Copilot's visibility in the toolbar. Real-time notifications for compromised passwords. Microsoft Edge is integrating an in-context password breach notification system. This feature proactively informs users if their saved login credentials have been compromised in known data breaches, enabling them to take immediate action to secure their accounts. Admins can control availability to this feature using the PasswordMonitorAllowed policy. Note: This is a controlled feature rollout. If you don't see this feature, check back as we continue our rollout. Edge Settings Improvements. Edge Settings is migrating to WebUI2 to boost page responsiveness and introducing a series of minor visual and content upgrades to improve overall usability and utility. This includes optimizing for concise wording of individual settings, simplifying the number of pages and reorganizing content, and creating a cohesive user interface. New Autofill Personal Information Settings Configuration. A web form field collection consent toggle will be available in Autofill settings (edge://settings/autofill/personalInfo). This allows users to consent to Microsoft Edge collecting web form field labels (e.g., "First Name," "Email") to improve Autofill suggestion accuracy. Only field labels are collected and not user-entered data. The web field labels are stored securely per Microsoft's privacy standards. This new setting is manageable via existing policies in Autofill (e.g., AutofillAddressEnabled), EdgeAutofillMlEnabled. AutofillAddressEnabledis the parent setting forEdgeAutofillMlEnabled. The EdgeAutofillMlEnabled policy is the parent of this new setting, thus turning off the EdgeAutofillMlEnabled policy turns off this setting. Web AI APIs for prompt and writing assistance. Microsoft Edge now implements the Writing Assistance APIs and the Prompt API (for Edge extensions) with a local language model, Phi-4-mini, that is built into the browser. These easy-to-use JavaScript APIs are made available via Edge flags (set to Enabled, by default only for the Summarizer and Prompt API for extensions) so that sites and extensions can apply AI capabilities on the web. The small language model is downloaded as the first time any of these APIs is used and later shared across all domains, serving local AI use-cases with reduced cost, network independence, and increased privacy (since data input to the model doesn't leave the user’s device). Admins can control the availability of these APIs via the GenAILocalFoundationalModelSettings policy. These APIs are currently not implemented in China. Read the announcement here, and feel free to provide feedback. Enhancements to Performance and Secure network. Browser essentials is now separated into two distinct experiences (Performance and Secure Network) - both available from the Settings and more menu (“…” on the menu bar). Reset Microsoft Edge enterprise sync. For users having problems syncing browsing data across other signed-in devices, they can reset sync data from the Microsoft servers via Edge Settings edge://settings/profiles/sync/reset. This option should only be used if the sync data is available on one of the user's devices or if they want to delete all sync data from the servers. Note: In Microsoft Edge 139, reset sync is enabled for users encountering a "No permissions" MIP error and in Microsoft Edge 140, reset sync is enabled for users encountering a "Service disabled" MIP error. Update to Microsoft AutoUpdate policy. The MAUEnabled policy allowed admins to continue using Microsoft AutoUpdate on macOS. Since Microsoft Edge now uses EdgeUpdate, the MAUEnabled policy is planned to be obsoleted in Microsoft Edge version 140. Policy updates / New policies EdgeOpenExternalLinksWithAppSpecifiedProfile - Prioritize App specified profile to open external links EnableUnsafeSwiftShader - Allow software WebGL fallback using SwiftShader MandatoryExtensionsForInPrivateNavigation - Specify extensions users must allow in order to navigate using InPrivate mode Microsoft365CopilotChatIconEnabled - Control whether Microsoft 365 Copilot Chat shows in the Microsoft Edge for Business toolbar OnSecurityEventEnterpriseConnector - Configuration policy for Microsoft Edge for Business Reporting Connectors Obsoleted policies KeyboardFocusableScrollersEnabled - Enable keyboard focusable scrollers (obsolete) SelectParserRelaxationEnabled - Controls whether the new HTML parser behavior for the SELECT element is enabled (obsolete) Download: Microsoft Edge (64-bit) | 180.0 MB (Freeware) Download: Microsoft Edge (32-bit) | 163.0 MB View: Microsoft Edge Website | Release History Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Week One Done
      harveycoleman123 earned a badge
      Week One Done
    • First Post
      EzraNougat earned a badge
      First Post
    • One Month Later
      westDvina earned a badge
      One Month Later
    • Community Regular
      Bern@rd went up a rank
      Community Regular
    • Week One Done
      Joey Solo earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      663
    2. 2
      +FloatingFatMan
      192
    3. 3
      ATLien_0
      154
    4. 4
      Xenon
      132
    5. 5
      wakjak
      98
  • Tell a friend

    Love Neowin? Tell a friend!