jamesdark1
Posts: 4
Joined: Sat May 18, 2019 4:34 am

Packages installing in wrong folder in Raspberry pi 3

Sun Jun 09, 2019 4:27 pm

Hi guys,

I have an issue that has been bugging me a while. I am trying to install text to speech packages, gTTs and pyttsx on my raspberry pi 3. Now the raspberry pi 3 has both a python 2.7 and a python 3.5 version installed. When I download the packages in the terminal, they download into the python 2.7 folder which I do not want because I am using idle 3.5 to run my scripts but the packages could not be found. So there is obviously some weird default of all my installed packages going into the python 2.7 folder instead of the python 3.5. I have tried cd to python 3.5 before installing and still does not work. How do I solve this?

thanks for any input.

User avatar
davidcoton
Posts: 3783
Joined: Mon Sep 01, 2014 2:37 pm
Location: Cambridge, UK

Re: Packages installing in wrong folder in Raspberry pi 3

Sun Jun 09, 2019 4:33 pm

How did you install them? What commands did you use?
Signature retired

Andyroo
Posts: 3306
Joined: Sat Jun 16, 2018 12:49 am
Location: Lincs U.K.

Re: Packages installing in wrong folder in Raspberry pi 3

Sun Jun 09, 2019 4:34 pm

Are you using apt / apt-get or pip to install the modules?

By default pip installs to Python and that points to Python 2.x You need to use pip3 to install to Python 3 or look for a specific Python 3 version.

(Its a real pain and one I struggle with as well so I'll watch this with interest.)
Need Pi spray - these things are breeding in my house...

User avatar
Imperf3kt
Posts: 2397
Joined: Tue Jun 20, 2017 12:16 am
Location: Australia

Re: Packages installing in wrong folder in Raspberry pi 3

Sun Jun 09, 2019 9:08 pm

I always thought you had to CD into the installation directory before downloading and installing? (or move the file to the target directory before installing)
Google is ubiquitous - Try it today, it's free!
https://opensource.com/life/16/10/how-ask-technical-questions

pfletch101
Posts: 437
Joined: Sat Feb 24, 2018 4:09 am

Re: Packages installing in wrong folder in Raspberry pi 3

Mon Jun 10, 2019 12:56 am

Imperf3kt wrote:
Sun Jun 09, 2019 9:08 pm
I always thought you had to CD into the installation directory before downloading and installing? (or move the file to the target directory before installing)
If you use pip, pip3, or apt (or apt-get, which is almost a synonym for apt), your files will be installed in the location which the utility chooses to use, and/or has been specified by the package creator. For these installers, it doesn't matter where you are 'located' when you run them, though they may behave somewhat differently depending on whether you run them with sudo or not. For other installation methods (wget, git, …), you should follow the package instructions, which will frequently require you to create directories or move files when you are done.

jamesdark1
Posts: 4
Joined: Sat May 18, 2019 4:34 am

Re: Packages installing in wrong folder in Raspberry pi 3

Mon Jun 10, 2019 8:22 pm

Andyroo wrote:
Sun Jun 09, 2019 4:34 pm
Are you using apt / apt-get or pip to install the modules?

By default pip installs to Python and that points to Python 2.x You need to use pip3 to install to Python 3 or look for a specific Python 3 version.

(Its a real pain and one I struggle with as well so I'll watch this with interest.)
Thank you, I used pip3 and installed. However, it appears some packages to do with the engine function in the pyttsx package is missing or not installed properly. Or possibly some incompatibility with the the pi not sure. But thanks so much for the suggestion.

Return to “General discussion”