Python Forum
Can't install pip for Python 3.7.4 in Ubuntu virtual OS
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can't install pip for Python 3.7.4 in Ubuntu virtual OS
#1
I'm trying to set up Python 3.7.4 on a virtual Ubuntu OS (version 15.04) running in VMWare so that I can use it to run a Linux script that someone wrote to convert a MuseScore file to a Synth V file, but everything I've tried has failed. I keep getting a message saying that pip can't be found. I'm not a Python programmer and don't plan to become one. I just need to have a functional Python 3 installation in order to run this script. The reason I need to install pip is that I need to install click because the script imports click and re before it starts to execute its commands. I've tried to contact the creator of the script, but he hasn't responded to any of my messages, so I decided to come here for help. He lives in Croatia and I live in New Mexico. I had originally installed Python 3.8 on my Windows 10 computer but the script wouldn't produce a correct output file after I got Python running and click installed. So, I decided to install Ubuntu on VMWare so that I could run the script on a Linux OS because it was created using Python 3.7 on Linux. I've probably spent about ten hours on this today already, so I'm getting very frustrated. Any help would be appreciated greatly!
Reply
#2
I had to install pip for 3.6 first

sudo apt install python3-pip
now you can install python 3.7

sudo apt install python3.7
and then I could install pip for 3.7

python3.7 -m pip install pip
and as a bonus, to install other modules just preface with

python3.7 -m pip install <module>
Reply
#3
I tried that, but it came back and said that it couldn't locate package python3-pip.

I also tried some of the steps that are suggested on the following page but without success:

https://askubuntu.com/questions/1061486/...h-18-04-in
Reply
#4
(Dec-30-2019, 08:29 AM)netbids Wrote: I tried that, but it came back and said that it couldn't locate package python3-pip.
Try:
sudo add-apt-repository universe multiverse
sudo apt update
sudo apt-get install -y python3-pip
Check install:
python3 -V
pip3 -V
Reply
#5
snippsat, I tried your suggestion but got an error after the first line, which is as follows:

Error: need a single repository as argument.

I have two other questions that occurred to me this morning. Originally, I had installed the version of Python that came with Ubuntu 15.04, which is version 3.4. But that version didn't install pip, and I wasn't able to install pip because it couldn't be found. That's why I decided to install a newer version. The reason I chose version 3.7.4 is that the developer of the script that I want to use has version 3.7. However, I couldn't find version 3.7 for Ubuntu, so I had to go with 3.7.4. Anyway, during the installation of version 3.7.4, I remember seeing a lot of messages scroll by that appeared to be errors. But my version inquiry returned the correct version number. So, if I ever do get pip installed but end up having problems running Python, I'm wondering if I'll have to revert back to version 3.4 and, if I do have to do that, will I be able to install pip and click for that version?

My second question pertains to the Windows 10 version of Python 3.7. I read somewhere that the best way to install that version is to do so from the Microsoft Store because it will automatically set up the correct path for running Python from any directory. So, I decided to install that version in place of the version 3.8 that I had previously installed from the Python download page because of the possibility that the reason I couldn't get the script to work is that I had a newer version of Python than was used for creating the script (3.8 vs. 3.7). But when I tried to run the script with version 3.7 for Windows 10, I got the same results that I got with version 3.8. Here's my question. Is it typical for scripts that are created in one OS environment (Linux, for example) to not work properly in another OS environment (Windows 10, for example), or am I not doing something right?
Reply
#6
Try single repository as argument.
sudo add-apt-repository universe
sudo add-apt-repository multiverse
sudo add-apt-repository restricted
The original Python version that comes with distortion,usually don't have pip3.
So the need to install it,also look this Thread
I use pyenv to install Python look at this Thread.

(Dec-30-2019, 04:17 PM)netbids Wrote: Anyway, during the installation of version 3.7.4, I remember seeing a lot of messages scroll by that appeared to be errors.
If install/build yourself remembered to install required packages first,this has tutorial.
sudo apt-get update
sudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget 
(Dec-30-2019, 04:17 PM)netbids Wrote: My second question pertains to the Windows 10 version of Python 3.7. I read somewhere that the best way to install that version is to do so from the Microsoft Store because it will automatically set up the correct path for running Python from any directory.
No use python.org,we have a tutorial here Python 3.6/3.7 and pip installation under Windows

(Dec-30-2019, 04:17 PM)netbids Wrote: Here's my question. Is it typical for scripts that are created in one OS environment (Linux, for example) to not work properly in another OS environment (Windows 10, for example), or am I not doing something right?
Python is a cross platform OS language,can of course write something specific to one OS that break this.
Reply
#7
Thanks for the info, snippsat. I guess I'll start over with the required packages for Python 3.7 in Ubuntu. Hopefully, I won't run into any issues running Python 3.7 in Ubuntu 15.04. If I do, I may have to revert back to the original version 3.4 of Python. All this time and effort just to run a single Linux script. Sad
Reply
#8
Well, I tried to download and install the required packages prior to installing Python per the first step in the tutorial, but some of the index files failed to download. According to the error message at the end of the process, they were either ignored or old ones were used instead. So, I don't know if I can continue with the installation process. Unfortunately, I don't know how to capture the list of failed downloads, so I can't share them here to find out what I should do next. But I'll keep the terminal window intact to refer to for whoever responds to my post.
Reply
#9
Okay, I decided to scrap Ubuntu and install Linux Mint Cinnamon 18.0 instead. This seems to have gotten me much farther than I was before. Python 3.5 is already installed. Pip 8 was already installed, but I updated it to version 19. Before doing that, however, I installed click because the script I'm using imports click as the first step followed by re. So then I tried to run my script but got the same error I was getting on Windows 10, which is that Python couldn't find click. This didn't make sense to me because I just installed it. So, I had to search and found that it was installed in the site-packages directory for Python 2.7, which is also installed. However, I need to use Python 3.5. So, I've been trying to figure out how to install click into Python 3.5 dist-packages folder but haven't been able to. Another option would be to modify the system path for Python 3.5 to find click where it's currently located, but the articles I've read don't tell me how to do that either. Is there someone here who can explain one of these options to me? I'll repeat them below:

1. How do I install click into Python 3.5 dist-packages directory?
or
2. How do I change the system path so that Python 3.5 can find click in the site-packages directory under Python 2.7?
Reply
#10
Wonder of wonders, I figured out how to get click installed properly. I was using pip instead of pip3. So, I had to install pip3 and then use pip3 to install click. So, I'm not getting the "click not found" error anymore, and the script is finally working. However, it is not producing the correct output file. Instead, it is producing the same kind of output file that the Windows setup was producing, which is useless. So, all I can do now is let the developer know the status of this process and wait to hear from him. At least now I have a working Python 3 in Linux as a starting point to debug the remaining issues. Thanks to everyone here who tried to help me get to this point.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Best practice on using virtual environments in Python bytecrunch 6 644 Feb-14-2024, 03:22 PM
Last Post: snippsat
  Virtual Env changing mysql connection string in python Fredesetes 0 325 Dec-20-2023, 04:06 PM
Last Post: Fredesetes
  Installing python packages in a virtual environment Led_Zeppelin 1 712 Aug-15-2023, 08:18 PM
Last Post: deanhystad
  Python in Singularity Container on Ubuntu erdemath 0 876 Aug-31-2022, 02:17 PM
Last Post: erdemath
  Python icons in Ubuntu KatManDEW 4 63,919 Aug-12-2022, 08:33 AM
Last Post: rob101
  can not install pymesh in ubuntu jerry 2 2,088 Mar-23-2022, 02:04 AM
Last Post: jerry
  Python 3.8 on Ubuntu 20.04 erdemath 1 1,333 Mar-07-2022, 09:31 PM
Last Post: Larz60+
  How do I link the virtual environment of that project to the 3.9.2 version of python? Bryant11 1 1,332 Feb-26-2022, 11:15 AM
Last Post: Larz60+
  install apache-airflow[postgres,google] on Python 3.8.12 virtual env ShahajaK 1 6,361 Oct-07-2021, 03:05 PM
Last Post: Larz60+
  Python script in Ubuntu core Nithin_Kumar 1 3,334 May-11-2021, 01:14 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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