Xcode: 'ModuleNotFoundError' - python

I am trying to run an app I have built using python and kivy. I have created an Xcode file which builds successfully, but when I simulate the app in Xcode the following error message is raised:
Traceback (most recent call last):
File "/Users/orlandoalexander/alarmclock-ios/YourApp/main.py", line 11, in <module>
ModuleNotFoundError: No module named 'osascript'
2021-03-07 20:39:05.124675+0000 alarmclock[2937:103283] Application quit abnormally!
2021-03-07 20:39:05.156979+0000 alarmclock[2937:103283] Leaving
Why would this be? Do I need to import the module 'osascript' into Xcode in some way?
I have installed osascript using pip3 via command line.

Try installing osascript using
pip install osascript
Or u need to update the pip package (windows)
python -m pip install --upgrade pip

Related

Linux commands error as if they were python modules

I'm running arch and when I try to use aws in the terminal I get a python-like error:
Traceback (most recent call last):
File "/usr/bin/aws", line 19, in <module>
import awscli.clidriver
ModuleNotFoundError: No module named 'awscli'
This happened for pip as well which I resolved by python -m ensurepip but I don't know why it was like that in the first place. I even tried explicitly adding the path to aws to my PATH to no avail.
Well, pip and other applications are in fact python programs. Apparently you just lack the 'awscli' module. A first try would be just install this module.
Try this command
sudo pip install awscli --force-reinstall --upgrade

Cannot import zmq in python using pycharm

I am trying to use the zmq Python library but it is not recognized and I have already installed it by using the following command:
pip3 install pyzmq
I am using PyCharm IDE.
The run output gives me this error:
Traceback (most recent call last):
File "C:/Users/Operações/Desktop/Testes/teste.py", line 2, in <module>
import zmq
ModuleNotFoundError: No module named 'zmq'
Does anyone can help me with this?
Instead of using pip, try installing pyzmq from File/Settings in PyCharm.
Open the Settings/Preferences
Navigate to Project: -> Python Interpreter
Klick the + at the bottom of the list
Search for your package of choice and hit Install Package
For more details on installing/uninstalling packages in PyCharm:
https://www.jetbrains.com/help/pycharm/installing-uninstalling-and-upgrading-packages.html

sudo install - Python 3?

I'm new to Linux and I'm trying to install packages through a Makefile so users can run my Python 3 program.
sudo pip install python3-weather-api
However, even after uninstalling a previously installed version, the package seems to be going to the 2.7 version of Python.
Requirement already satisfied: python3-weather-api in /usr/local/lib/python2.7/dist-packages
Then, when I run the program, it can't find the module (it works locally in Python 3 just fine).
SystemExit: 1
Traceback (most recent call last):
File "project.py", line 11, in <module>
from weather import Weather
ImportError: No module named 'weather'
Is there a way I can point the original installation so when I run python3 project.py it can find the module?
Thanks very much!
I would recommend you to use pyenv to manage your Python installations, but, for now, try to run:
sudo pip3 install python3-weather-api

How do I fix this error I'm getting when I try to install this package with pip install?

I'm new to Python and I've been trying to start a Discord bot on my computer, but whenever I try to install sudo pip install discord.py I get the following error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-QOFKFs/aiohttp/setup.py", line 60, in <module>
raise RuntimeError("aiohttp requires Python 3.4.2+")
RuntimeError: aiohttp requires Python 3.4.2+
I'm running Linux Mint 18.2 and I'm almost 100% positive I've got Python and Pip up to date.
Have you check pip is really pip for python3 and python's version?
You could using pip for python2.
Like this link

ModuleNotFoundError after installing requests package

I am on Mac OS Sierra, with home-brew, pip and python3 installed. I Tried running a script that required the requests module, but I keep getting this error:
Traceback (most recent call last):
File "listing_seq.py", line 1, in <module>
import requests
ModuleNotFoundError: No module named 'requests'
Despite running:
sudo pip3 install requests
sudo pip install requests
sudo pip install requests --upgrade
Any suggestions?
Update:
When I try running using virtualenv I get:
Running virtualenv with interpreter /usr/local/bin/python3
ERROR: File already exists and is not a directory.
Please provide a different path or delete the file.
The most common error is having another file with the name of any of the libraries you requested in the same path.
The other possible error is if the python you are using to execute the file is not python 3 but rather the defalut python from your OSX. See the accepted answer on this for better understanding of a possible issue. Also share your code to identify the bug.

Categories