Jupyter Notebook in Anaconda Not Loading - python-3.x

Whenever I try to open Jupyter Notebook from the Anaconda GUI (or conda terminal), I get the following error:
Traceback (most recent call last):
File "C:\Users\loops\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 10, in
import sqlite3
File "C:\Users\loops\AppData\Local\Continuum\anaconda3\lib\sqlite3\__init__.py", line 23, in
from sqlite3.dbapi2 import *
File "C:\Users\loops\AppData\Local\Continuum\anaconda3\lib\sqlite3\dbapi2.py", line 27, in
from _sqlite3 import *
ImportError: DLL load failed: The specified procedure could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\loops\AppData\Local\Continuum\anaconda3\Scripts\jupyter-notebook-script.py", line 6, in
from notebook.notebookapp import main
File "C:\Users\loops\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\notebookapp.py", line 86, in
from .services.sessions.sessionmanager import SessionManager
File "C:\Users\loops\AppData\Local\Continuum\anaconda3\lib\site-packages\notebook\services\sessions\sessionmanager.py", line 13, in
from pysqlite2 import dbapi2 as sqlite3
ModuleNotFoundError: No module named 'pysqlite2'
I've gone so far as to uninstall Python, uninstall Anaconda, remove all python related path variables, and reinstall Anaconda with Python. This still has not worked. Is there any way to resolve this error? I've looked on many different sites but I haven't found much help.
EDIT: To add more context, it broke randomly one day and I don't have the slightest idea why. Anaconda had worked for a year or so prior. I checked both scripts that are referenced in the error prompt and they both exist in the directory.

I had the same problem.
The issue seems to arise from the missing of sqlite3.dll in the path ".\Anaconda\Dlls".(if using an env, you should put it under the env directory like ".\your env\DLLS") I solved it by simply copying that .dll file from others and put it under the path mentioned above.
You can download the sqlite3.dll from this link: sqlite3.dll

Related

Error using Nuitka for Python App that uses Numpy, Pandas and Plotly

I've developed a PyQT5 app that also uses Numpy, Pandas and Plotly. To package it up I decided to use Nuitka however since the product is for the end users who won't be familiar with Python, I want to make sure the interpreter is packaged up along with the app as a single binary (similar to PyInstaller).
I'm running the following command however have been getting errors that I'm struggling to figure out how to fix:
$ python -m nuitka --standalone --show-progress --recurse-all --plugin-enable=numpy main.py
I'm using PyCharm and all the libraries are in the Virtual Environment in project directory. The version of Python I'm using is 3.9.
An executable binary is generated in Windows however upon running I receive the following error message:
C:\Users\user\PycharmProjects\PlotlyExample\main.dist>main
Traceback (most recent call last):
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\__init__.py", line 22, in <module numpy.core>
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\multiarray.py", line 12, in <module numpy.core.multiarray>
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\overrides.py", line 7, in <module numpy.core.overrides>
ImportError: LoadLibraryExW 'C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\_multiarray_umath.pyd' failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\main.py", line 5, in <module>
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\__init__.py", line 140, in <module numpy>
File "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\__init__.py", line 48, in <module numpy.core>
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "C:\Users\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\python.exe"
* The NumPy version is: "1.19.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: LoadLibraryExW 'C:\Users\\user\PYCHAR~1\PLOTLY~1\MAIN~1.DIS\numpy\core\_multiarray_umath.pyd' failed: The specified module could not be found.
Sample Code:
https://pastebin.com/RjRYUk0C
Any ideas? Thanks!

Error while configuring pycharm with odoo-13

I am trying to configure a new project to Odoo on Windows however when I run the project after specifying odoo-bin as the Script path this error appears to my:
Traceback (most recent call last):
File "D:/Odoo 13_20200903/server/odoo-bin", line 5, in <module>
import odoo
File "D:\Odoo 13_20200903\server\odoo\__init__.py", line 75, in <module>
import PyPDF2
ModuleNotFoundError: No module named 'PyPDF2'
Any idea how can it be fixed?
Thanks in Advance
The Python interpreter used differs from the interpreter in which the libraries are loaded, make sure that the required interpreter path, may be inside a venv or another name.

Installation of numpy through Anaconda

getting up to speed on Anaconda, I keep receiving an error message when I try to import 'numpy' into Python.
Here is what I have done so far:
Downloaded anaconda from anaconda.com (64-Bit Graphical
Installer (466 MB) with Python 3.7 for Windows);
Installed anaconda (under C:\Users\'Username'\Anaconda3 | Option 'Register Anaconda3 as my default Python 3.7')
Now I'm trying to import numpy into Python using idle.exe, which produces following error message:
Warning: os.path.expanduser("~") points to
h:\,
but the path does not exist.
Futhermore, after executing "'import 'numpy;" in IDLE I get the following error message.
Unfortunately none of the advice was helpful. Numpy seems to be properly installed.
Warning (from warnings module): File "C:\Users\'Username'\Anaconda3\lib\site-
packages\numpy\__init__.py", line 140
from . import _distributor_init
UserWarning: mkl-service package failed to import, therefore Intel(R) MKL
initialization ensuring its correct out-of-the box operation under condition
when Gnu OpenMP had already been loaded by Python process is not assured.
Please install mkl-service package, see http://github.com/IntelPython/mkl-
service
Traceback (most recent call last):
File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\__init__.py",
line 24, in <module>
from . import multiarray
File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\multiarray.py",
line 14, in <module>
from . import overrides
File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\overrides.py",
line 7, in <module>
from numpy.core._multiarray_umath import (
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\'Username'\Anaconda3\Scripts\myscripts\import_test.py", line 1,
in <module>
import numpy
File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\__init__.py", line
142, in <module>
from . import core
File "C:\Users\'Username'\Anaconda3\lib\site-packages\numpy\core\__init__.py",
line 54, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy c-extensions failed.
- Try uninstalling and reinstalling numpy.
- If you have already done that, then:
1. Check that you expected to use Python3.7 from
"C:\Users\'Username'\Anaconda3\python.exe",
and that you have no directories in your PATH or PYTHONPATH that can
interfere with the Python and numpy version "1.18.1" you're trying to use.
2. If (1) looks fine, you can open a new issue at
https://github.com/numpy/numpy/issues. Please include details on:
- how you installed Python
- how you installed numpy
- your operating system
- whether or not you have multiple versions of Python installed
- if you built from source, your compiler versions and ideally a build log
- If you're working with a numpy git repository, try `git clean -xdf`
(removes all files not under version control) and rebuild numpy.
Note: this error has many possible causes, so please don't comment on
an existing issue about this - open a new one instead.
Original error was: DLL load failed: The specified module could not be found.
Many thanks in advance for any help and suggestions.

ModuleNotFoundError: No module named '_pydevd_bundle'

Out of the blue I got the error listed below.
I am using Eclipse IDE and I have Python 2.7 and 3.6 installed (both WinPython)
I don't know when this started because I have worked for a while in 2.7. I just tried some code which I am writing in Jupyter and it is not working and I wanted to debug it easier in Eclipse. When I press the debug button I get the below
Traceback (most recent call last):
File "C:\Utils\PortableApps\PortableApps\Eclipse 4.6\plugins\org.python.pydev.core_7.0.3.201811082356\pysrc\pydevd.py", line 20, in <module>
from _pydevd_bundle.pydevd_constants import IS_JYTH_LESS25, IS_PYCHARM, get_thread_id, get_current_thread_id, \
ModuleNotFoundError: No module named '_pydevd_bundle'
It's absolutely due to that your files contain a dir named code! The name has conflicted with the system package. Just modify the dir name code to any name else. It should work well!

PyCharm unittests: AttributeError: module 'enum' has no attribute 'IntFlag'

I have an error that only appears when running unittests inside of PyCharm.
Python 3.6.5 on OSX.
/Users/me/project/env/bin/python /Applications/PyCharm.app/Contents/helpers/pycharm/_jb_unittest_runner.py --target test_module.TestClass.test_method
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pycharm/_jb_unittest_runner.py", line 4, in <module>
from unittest import main
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/__init__.py", line 58, in <module>
from .result import TestResult
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/unittest/result.py", line 5, in <module>
import traceback
File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/traceback.py", line 5, in <module>
import linecache
File "/Users/enos/patrf/api/env/lib/python3.6/linecache.py", line 11, in <module>
import tokenize
File "/Users/enos/patrf/api/env/lib/python3.6/tokenize.py", line 33, in <module>
import re
File "/Users/enos/patrf/api/env/lib/python3.6/re.py", line 142, in <module>
class RegexFlag(enum.IntFlag):
AttributeError: module 'enum' has no attribute 'IntFlag'
This error seems related to Why Python 3.6.1 throws AttributeError: module 'enum' has no attribute 'IntFlag'?
The suggestions there don't work here.
Adding enum-compat to requirements.txt doesn't change anything.
A trivial unit test .py file that imports nothing at all still shows this problem.
There are no enum.py files in my project directory.
Happens with a clean virtualenv and a clean venv.
Everything works fine outside of PyCharm.
This only appears to happen in the one project I have that uses Graphene, which does have an enum.py, but even deleting those files has no effect. find . -name "enum.py" returns nothing.
Any PyCharm experts have an idea? I really like to run my tests inside of PyCharm and I'd love to be able to do so for this project.
I ran into this issue as well. I was able to solve it by removing the enum34 package. Even if you're using venv you need to make sure that you check all directories that the PyCharm Project Interpreter is adding to the PYTHONPATH. Just running pip uninstall enum34 may not fix the issue.
In my case, I had PyCharm loading extra directories to the PYTHONPATH and the enum34 package was included in one of them. Removing it from that directory solved the issue.

Resources