[SOLVED] Attempting to understand how/where Ubuntu stores files
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Attempting to understand how/where Ubuntu stores files
If I open a terminal and type: python3 it will run python3.5.2. How can I find where exactly in my computer this interpreter is located?
The reason I ask is I think I may have multiple versions of the same interpreter on my computer because my IDE PyCharm doesn't seem to have access to modules that I download via: apt-get install or pip.
I wouldn't start fiddling directly with Python executables though, since they are essential to a fair bit of the workings of the system.
What you should be aware of is that your system will probably have both Python 2 and Python 3 installed and will need both of these (since different software on your system could use either). You may find that you are installing modules in Python 2 and then trying to access them in Python 3. Python3, for example, uses pip3.
It would be useful if you were to give us one example of a module that you can't access so that we can see why that isn't working.
Distribution: Currently: OpenMandriva. Previously: openSUSE, PCLinuxOS, CentOS, among others over the years.
Posts: 3,881
Rep:
Quote:
Originally Posted by vysero
If I open a terminal and type: python3 it will run python3.5.2. How can I find where exactly in my computer this interpreter is located?
The reason I ask is I think I may have multiple versions of the same interpreter on my computer because my IDE PyCharm doesn't seem to have access to modules that I download via: apt-get install or pip.
The "find" and "locate" and "whereis" commands spring to mind straight away.
I wouldn't start fiddling directly with Python executables though, since they are essential to a fair bit of the workings of the system.
What you should be aware of is that your system will probably have both Python 2 and Python 3 installed and will need both of these (since different software on your system could use either). You may find that you are installing modules in Python 2 and then trying to access them in Python 3. Python3, for example, uses pip3.
It would be useful if you were to give us one example of a module that you can't access so that we can see why that isn't working.
I did a sudo apt-get install python-qt4. I can use the module (at least I believe it is called a module) in a terminal with python 3.5.2. However, when I load PyCharm and I select the Base interpreter for some .py script to be python3.5 from: /usr/bin/python3.5 and I select the Inherit global site-packages check box it doesn't show pyqt4 anywhere in the list of packages that it populates.
How is it that from a terminal using python3.5 I have access to the pyqt4 module but not from within PyCharm is what I am asking myself. I figured, maybe I have two different versions of the python3.5 interpreter downloaded on my computer and 2 different locations where those intersperses are storing their modules?
A quick note: using which python3.5 tells me that the interpreter is located @ /usr/bin/python3.5 which is the same location that PyCharm says it has found the python3.5 interpreter, now I am very confused.
ii libpython3.5:amd64 3.5.2-2ubuntu0~16.04.4 amd64 Shared Python runtime library (version 3.5)
ii libpython3.5-dev:amd64 3.5.2-2ubuntu0~16.04.4 amd64 Header files and a static library for Python (v3.5)
ii libpython3.5-minimal:amd64 3.5.2-2ubuntu0~16.04.4 amd64 Minimal subset of the Python language (version 3.5)
ii libpython3.5-stdlib:amd64 3.5.2-2ubuntu0~16.04.4 amd64 Interactive high-level object-oriented language (standard library, version 3.5)
ii python3.5 3.5.2-2ubuntu0~16.04.4 amd64 Interactive high-level object-oriented language (version 3.5)
ii python3.5-dev 3.5.2-2ubuntu0~16.04.4 amd64 Header files and a static library for Python (v3.5)
ii python3.5-minimal 3.5.2-2ubuntu0~16.04.4 amd64 Minimal subset of the Python language (version 3.5)
Another quick update. I managed to get PyCharm run from the interpreter located at /usr/bin/python3.5 and now it is not throwing me errors when I pull from the pyqt4 module with this script for instance:
However, running the application does not open up a window like it would if I was running the same script in a terminal. Also, now when I attempt to install packages from within PyCharm via the project interpreter page it asks me for the sysadmin password. I guess I am left wondering:
a) What interpreter I was using before such that I did not have access to all the packages I would normally have access to via a terminal but I did not have to enter my sysadmin password
b) Why is the PyCharm IDE unable to run pyqt4 in the same way that a terminal can and
Apparently, in PyCharm there is a Virtualenv Enviorment where you can select the python3.5 interpreter; however, you will not be able to use the same packages it uses. Instead, if you select System Interpreter (rather than Virtualenv) then you can use the packages you already have installed but you will need to provide admin permissions to install new packages. That being said it doesn't seem to matter because I can't do what I want to do which is use pyqt4 with either route.
With the Virtulenv Enviorment route it gives me an error when attempting to install the pyqt4 package and with the System Interpreter route it says I have pyqt4 but it does not function like I would expect. I have looked online and other people have had similar problems; however, their solutions do not work for me. I have attempted going to the source and raised a query at: https://intellij-support.jetbrains.com but in my experiance those query's never get answered.
ii libpython3.5:amd64 3.5.2-2ubuntu0~16.04.4 amd64 Shared Python runtime library (version 3.5)
ii libpython3.5-dev:amd64 3.5.2-2ubuntu0~16.04.4 amd64 Header files and a static library for Python (v3.5)
ii libpython3.5-minimal:amd64 3.5.2-2ubuntu0~16.04.4 amd64 Minimal subset of the Python language (version 3.5)
ii libpython3.5-stdlib:amd64 3.5.2-2ubuntu0~16.04.4 amd64 Interactive high-level object-oriented language (standard library, version 3.5)
ii python3.5 3.5.2-2ubuntu0~16.04.4 amd64 Interactive high-level object-oriented language (version 3.5)
ii python3.5-dev 3.5.2-2ubuntu0~16.04.4 amd64 Header files and a static library for Python (v3.5)
ii python3.5-minimal 3.5.2-2ubuntu0~16.04.4 amd64 Minimal subset of the Python language (version 3.5)
Only one version of Python 3 installed then (3.5.2). To me the evidence points towards this being a specific PyCharm issue.
So the symbolic links give python = python2 = python2.7 and python3 = python3.4 and additionally python3m = python3.4m (both versions exist and are identical)
Obviously someone fouled up badly on the whole version numbering thing.
Apparently, in PyCharm there is a Virtualenv Enviorment where you can select the python3.5 interpreter; however, you will not be able to use the same packages it uses. Instead, if you select System Interpreter (rather than Virtualenv) then you can use the packages you already have installed but you will need to provide admin permissions to install new packages. That being said it doesn't seem to matter because I can't do what I want to do which is use pyqt4 with either route.
With the Virtulenv Enviorment route it gives me an error when attempting to install the pyqt4 package and with the System Interpreter route it says I have pyqt4 but it does not function like I would expect. I have looked online and other people have had similar problems; however, their solutions do not work for me. I have attempted going to the source and raised a query at: https://intellij-support.jetbrains.com but in my experiance those query's never get answered.
Any ideas in the meantime?
This is a post which explains (at least for me) that you still did not tell us your real problem, what do you want to achieve and other details. What you wrote here contains no usable information. I would suggest you to start over again and speak about your issue. Where did you stuck?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.