I am trying to compile my python program into an android APK file. I installed the package 'python-for-android'. when i tried to use it, i go an error saying C:\Program Files\Python39\python.exe: No module named python-for-android. Can someone please tell me what is going wrong?
https://pypi.org/project/python-for-android/
It looks like it is being installed into a different location than where you pip installed the library. If you can give more details about how you installed the package, it might help identify the issue.
Is it possible that you have two python versions, and it installed it into the wrong version.
Using virtual environments might make it easier to understand what is going on. If you pip install into a virtual environment, you can be pretty confident that it is installing into the correct version of python.
Related
I am trying to check what packages are installed in my virtual environments, I have different packages from different virtual environments depends on what project I am working on. Whatever virtual environment I switch I always get this error when using help("modules")
aiohttp dependency is not installed: No module named 'aiohttp'. Please re-install black with the '[d]' extra install to obtain aiohttp_cors: `pip install black[d]`
My question is how do I install this package correctly, and by that I mean should I install it in my main Python PATH? I'm not sure if this is a mandatory package that I need it installed in my main environment if that makes sense.
My Python version is 3.9.6 by the way.
EDIT: I was able to fetch all of my packages.
I had to do a . Scripts/activate first, but it was weird because before I did not have to do the activate command before, since VS Code displays on the lower left portion of the screen what environment you are currently using, I'm not sure if I had any settings change prior to this bug.
Maybe you should try to open new terminal
I'm sorry if this is a basic question, but I'm hoping someone can clarify something that may be quite simple.
What I want is to use the tool eyeD3 which is a CLI. The confusing bit is that on the install page it says it should be installed with Pip. Thus, I created a virtual environment and installed the package there.
Okay great, but how do I actually use it now? Because every instruction says to use it as a command line tool. But if it's installed as a pip package then the "eyed3" command is not magically going to be placed in my PATH to be used as intended. So what am I not getting here?
Alternatively I may just download it using sudo dnf install python-eyed3 which should work.
But I really want to educate myself if I'm understanding something wrong, so I can better understand and utilize pip and virtual environments with Python.
I'm working with Concept Drift, but when trying to run my code i get this error
"ImportError: No module named detector_classifier" been trying to install the module with pip install, but all i get is no match found. Anyone had this problem before?
Before you can import third party libraries, you need to install first. If you could not install with pip install, it means it's not published on PyPI. You need to install directly from source where you found code/module for Concept Drift or detector_classifier, or whatever you're trying to use.
I think a little more information might help. Which python version and which pip version are you using? I just googled "detector_classifier" and couldn't find anything. What library does "detector_classifier" belong to?
Without much background to go off of, I would recommended making sure you have updated pip. Depending on what operating system you're using, your configuration might need some tinkering so your system knows where to look.
I'm working on a script that will plot data onto a map using the Basemap library. I'm trying to import Shapely as well for use in this same script. I'm working with Anaconda2 for Python2.7 in a Windows 7 environment. I used conda install to download the tar.bz2 file from the Conda Packages site (using Windows command line) and it looked like it all installed correctly.
When I open Pycharm and look at my accessible site-packages, I can see this package. However, when I try to use it within my script, I get an error saying that the package does not exist. I ran the script through the debugger to see if it would shed any more light, but I got the same error. Here's a screenshot of my available site packages when I go to Settings-->Project Interpreter from within Pycharm.
Screenshot of PyCharm site packages available
Is there something special I need to do in order to access this package from within a fresh Python file? I was trying to say "import shapely" or "import osx-64-shapely", but both give me the same "package does not exist" error message. I've been able to successfully use other third-party libraries within Python, so I'm not quite sure what the error is here....
I'm new to SO - if you need more details or there's some piece of info I didn't include, please let me know. Thank you for your help!
EDIT: I am NOT asking what the difference is between conda and pip, or how to use pip within PyCharm. I have used both successfully before to install third-party libraries. What I am asking is what might cause a third-party library that appears to have installed successfully from the command line become inaccessible from within PyCharm when I attempt to import it.
I'm not familiar with Shapely but I was astonished to see the name osx-64-shapely as a site-package for your python installation which is in windows 7. Are you sure you downloaded the right file? :)
I'm in the process of trying to install rpy or rpy2 on my Macbook so I can use R from python. Information about rpy can be found here: http://rpy.sourceforge.net/index.html
My problem is in the installation itself. I can't seem to make python recognize Rpy using import command: I keep getting the message "No module named rpy2". Does anyone know where I can find some step-by-step instructions on how to successfully install this? I have already installed both python and R, and both are working perfectly. Thanks in advance!
Try easy_install rpy2. You need to install easy_install before that.
I took that from here
I long gave up on these issues on my Mac. Since I installed OS Lion, I found that I needed to switch to MacPorts and then installing packages like RPy2 from their repository.
I know some people like to dig into the system and learn all the idiosyncrasies of the architecture and keep a vanilla install of python on their Mac. I find that i get problems like yours too frequently and they distract me from real work.
I just download the MacPorts modules when I need them and get on with the problem at hand. Others say the same thing about HomeBrew but I have only worked with MacPorts and it makes installation of modules too easy. You may want to invest some time investigating if either of these solutions work for you.
Another approach to using package managers like MacPorts or HomeBrew is to use a virtualenv and install python and all related modules there. Again, not a solution I have tried directly, but a quick search will show you many endorsements for this approach to using a specific Python executable and packaging its modules In an isolated environment.
as long as you have pip installed on your mac, then life will be easy as:
sudo pip install rpy2
If you want rpy it isn't on macport, at least a search of their packages only showed rpy2. According to the rpy web site its in fink. However at the moment fink is down so I can't verify this. Which is irritating because I need rpy (not rpy2) because another package has a dependency on it.
I also tried pip to find rpy and it said no package, which is a shame because pip is great for python installs (provided I remember to use 'sudo' first.