I've decided to give Python a try on Netbeans. The problem so far is when try to run program I know works, i.e. if I ran it through the terminal. For the project I selected the correct Python version (2.6.5). And received the following error:
Traceback (most recent call last): File
"/Users/XXX/NetBeansProjects/NewPythonProject3/src/newpythonproject3.py",
line 4, in
import sqlite3 ImportError: No module named sqlite3
Search for PYTHONPATH. You probably have different settings in your OS and Netbeans.
Related
I have my own project with virtual environment. When I am trying to debug code everything executes flawlessly and I get the expected output, but when I am trying to run it with run code option from Code Runner extension I receive the error:
[Running] python -u "c:\Users\slikm\Pulpit\ytapi\yt_api.py" Traceback (most recent call last): File "c:\Users\slikm\Pulpit\ytapi\yt_api.py", line 2, in <module> from googleapiclient.discovery import build ModuleNotFoundError: No module named 'googleapiclient'
I have the library which the module is taken from installed on my venv. I read that the problem might be with the interpreter the extension uses, but I don't really know how to figure it out.
In the process of downloading mysql connector, I've taken 3 approaches:-
The commonly advised pip approach where I think the PATH (Python on system; which I don't think I understand) fails me since it doesn't seem to install mysql.connector. It gives a deprecation, collects mysql.connector and launches an error.
Direct download through this site: https://dev.mysql.com/downloads/connector/python/ whereby I've changed security preferences(since it was an unidentified by apple developer) and tried downloading but the application doesn't appear anywhere on my desktop and I can't seem to find it anywhere else.
I followed this link: https://www.youtube.com/watch?v=1ji8lqiBJe0 and everything went fine till 1:34. I don't use pycharm so I decided to directly write import mysql.connector on idle.
At first, it would give me this error:-
Traceback (most recent call last):
File "", line 1, in
import mysql.connector
ModuleNotFoundError: No module named 'mysql
Now it presents this error:-
Traceback (most recent call last):
File "", line 1, in
import mysql.connector
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/mysql/connector/init.py", line 41, in
import dns.resolver
ModuleNotFoundError: No module named 'dns'
I can't seem to understand where 'dns module' comes from. Could anybody help me on how to proceed? I think I've exhausted every method at this point but can't find an error.
Have you correctly install dnspython ?
pip install dnspython
https://github.com/rthalley/dnspython
and the connector for your OS
https://dev.mysql.com/downloads/connector/python/
I am getting below ImportError while running a python file.
ImportError: No module named osgeo.gdal_array
!/usr/bin/env python
from osgeo.gdal_array import BandReadAsArray
However, if i try to import same from command line, it runs fine.
$ which python
/home/hduser/anaconda2/bin/python
$ python
>>> from osgeo.gdal_array import BandReadAsArray
>>>
Also, please see the below where i am getting the same ImportError.
$ /usr/local/bin/python2.7
>>> from osgeo.gdal_array import BandReadAsArray
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named osgeo.gdal_array
I figured out that there is something going on between different versions of python. But, i do not want to change the original source code.
How do i make my program run without changing anything within the code of calling python installed in anaconda explicitly?
I downloaded this library: https://github.com/bufferapp/buffer-python
Ran the setup.py install, and then tried to run some code using the newly installed library.
What happens though is I get this error:
Traceback (most recent call last):
File "twitter-quote-bot.py", line 14, in <module>
from buffpy.managers.profiles import Profiles
ImportError: No module named managers.profiles
The only way I've found to fix it is to move my program (twitter-quote-bot) into the downloaded folder from Buffer and run it there.
Did I do something wrong in the installation? It seems like I should be able to do these imports globally.
Thanks in advance!
import gspread
rest of the code.
error :
Traceback (most recent call last):
File "C:\QSTK\Examples\MyCodes\gspread.py", line 1, in
import gspread
when i try to run the code in spyder i get this error.
the code works fine in python idle
Rename your script. You named it the same as a module you are trying to use, gspread, this causes a circular dependency.