I am using the book Python Crash Course as a textbook. I was doing pretty well until I tried to use the Matplotlib library. The book gave the following command to install the library:
python -m pip install --user matplotlib
I entered this in the terminal window in Pycharm (the IDE I am using). It appeared to work, in that I got a series of messages indicating that files were being downloaded and installed on my computer. However when I attempted to import matplotlib.pyplot into an example piece of code I was trying to write, I got a ModuleNotFoundError: No module named 'matplotlib'
I assumed that the downloaded module went to the wrong directory, so I searched my hard drive to find a file or folder named matplotlib. I found several folders in different locations, but when I tried copying them into folders where I knew Pycharm could find it, it didn't seem to help. Can someone please clue me in to how I can use this module.
I am using windows 10 on an MS Surface 6.
I am trying to do the following in Python 3.7.1 on Windows
import sqlite3
but I get the following error message
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "c:\programdata\anaconda3\lib\sqlite3\__init__.py", line 23, in <module>
from sqlite3.dbapi2 import *
File "c:\programdata\anaconda3\lib\sqlite3\dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: DLL load failed: The specified module could not be found.
I have searched for a solution to the problem for quite a while now to no avail. I have also successfully run pip install pysqlite3 on the Anaconda prompt, but the import still fails. What do?
I got this working on windows by downloading: the sqlite3 dll (find your system version)
And placing it into the folder: C:\Users\YOURUSER\Anaconda3\DLLs
(Depending on how you installed Anaconda, this may have to be placed into
the following folder: C:\ProgramData\Anaconda3\DLLs)
According to #alireza-taghdisian, you can locate the exact path of
your conda environments (where you need to copy the sqlite3 dll) by typing:
conda info --envs on your anaconda prompt.
Locate the sqlite3.dll file. In my case it was in following folder
C:\Users\Admin\anaconda3\Library\bin
where C:\Users\Admin\anaconda3 is the folder where Anaconda was installed
Add this to PATH in environment variables, and it should work then.
Try copying the sqlite3.dll from the
C:\Users\YOURUSER\anaconda3\Library\bin
folder to
C:\Users\YOURUSER\Anaconda3\DLLs
Please check https://github.com/jupyter/notebook/issues/4332
I added anaconda root/Library/bin to my PATH and now it works!
Add CONDA_DLL_SEARCH_MODIFICATION_ENABLE=1 to your environment variables.
before executing the program, enter conda activate in your shell.
I had tried all above solutions But for me and my system I got to know that
I downloaded Python in C:\Python27 hence there is dll folder in python C:\Python27\DLLs
I installed Sqlite3.dll in my above dll folder
May be this solution will help you because it completely depends on where do you install your python
Happy coding :)
I put the sqlite3.dll in the path folder of my Python venv and still wont work. I suspected it is a path problem.
(In my case: E:\Virtual_Env\mini_zinc\env\Scripts)
I found in my case I messed up installation in a virtual evn, somehow using an anaconda python kernel within a Python venv.
I reinstall the Python Venv and check the python version after installed Env is correct (not the Anaconda python), then proceed with Jupyter Notebook (or Juyterlab) and works fine.
I was able to resolve this issue by putting sqlite3.dll file in the C:\Users<USERID>\AppData\Local\conda\conda\envs<ENV NAME>\DLLs.
Download sqlite3.dll file from https://www.sqlite.org/download.html
or copy it from C:\ProgramData\Anaconda3\DLLs\
I found the #elgsantos useful. But for those who are new to Python and Conda like me, I would like to add a little bit of details.
1- I use miniconda3 for creating new environment.
2- interestingly, I got two installation path on my computer for conda: the first one (the obvious) is located on "C:\Users\taghdisian\miniconda3". The second one is on "C:\Users\taghdisian\AppData\Local\r-miniconda". The latter is the primary path that you need to copy your sqlite3 files into the envs folder. I copy them in the "C:\Users\taghdisian\AppData\Local\r-miniconda\envs\sdr3.9\DLLs" in which the sdr3.9 is one of my virtual Condo environment.
you can locate the exact path of your conda environments (where you need to copy sqlite3) by typing the conda info --envs on your anaconda prompt.
I hope this help.
got the same error while loading the jupyter notebook from other conda prompt than "base" environment.
[1]: https://i.stack.imgur.com/2DW7E.png
Resolved by installing sqlite package
(nlpenv) C:\Users\arunk>conda install sqlite
launching
*
(nlpenv) C:\Users\arunk>jupyter notebook
I'm playing with the MapR Sandbox and would like to import some data in MapR stream using python. But I'm having an importing issue and I dont know why. I followed instructions from MApR website (see reference at the end of this post) and looked everywhere for a clue, but know I don't really know what else I can do. I tried with python 2.7 and python 3.6.
File "producer.py", line 1, in <module>
from mapr_streams_python import Producer
ModuleNotFoundError: No module named 'mapr_streams_python'
I have installed it globally like doc is telling me to do, the file is located in /usr/lib64/python2.7/site-packages for python 2 /usr/lib64/python3.6/site-packages for python 3
Someone has an idea?
Thank you
References
https://mapr.com/docs/60/AdvancedInstallation/InstallingStreamsPYClient.html
https://mapr.com/docs/52/MapR_Streams/MapRStreamsPythonExample.html
I noticed that the folder for the module was incorrectly named in the folder that it was installed at. After getting to the directory with the modules (/usr/lib64/python3.6/site-packages), just run this command:
cp -R mapr_streams_python-0.11.0-py3.6.egg-info/ mapr_streams_python
You should then be able to import the package in python.
I currently have an error while installing tensorflow with python 3. Previously I had successfully installed tensorflow with python 2, and that was after I commented out several sections for ios/android. I decided to copy over the exact tensorflow files that worked for the python 2, and reconfigured the settings to suit it for python 3. Is this correct? Because I figured the configurations would be overwritten if I reconfigure the same files, and the edited files I require for TensorFlow to work will still be present.
Here is my error code:
error loading package 'bazel-tensorflow/external/bazel_tools/tools/build_defs/docker/testdata': Extension file not found. Unable to load package for '//tools/build_defs/docker:docker.bzl': BUILD file not found on package path.
I'm trying to import everything from nodebox.graphics into my python 3.5 code but I get errors:
ImportError: No module named 'bezier'
To mention, this module exists in nodebox/graphics. As I searched in python documentations, I have to add the nodebox and pyglet folders into the directory of my code but that did not work.
I also didn't succeed in adding them to system directories.
How can I solve the problem and run my code properly?
P.S. I'm currently using ubuntu 16.04 if it matters.
I had the same error. Placing all the .py files except (and this is important) the __init__.py file in the main libraries folder fixed it for me. The final path should look like ~/lib/python3.5/site-packages/bezier.py