plotly / dash

Data Apps & Dashboards for Python. No JavaScript Required.
https://plotly.com/dash
MIT License
21.57k stars 2.08k forks source link

[BUG] OSError: [WinError 126] The specified module could not be found [solved] posted for information. #1587

Closed aspiringguru closed 3 years ago

aspiringguru commented 3 years ago

python

import dash .... OSError: [WinError 126] The specified module could not be found

started writing this up as a bug. Realised my python base environment is a mess via checking the error messages, tried using a python virtual environment and problem solved. leaving this here in hope an alternate version of me solves the problem as I didn't see this documented elsewhere.

python -m venv env .\env\Scripts\activate pip freeze

no packages installed.

pip install dash python

import dash

works.

clean reinstall of python reccomended + consistent use of virtual environments as a habit.

------------------------------------------------------------------------------------------------------------

This might be more of an environment / package management issue than bugs internal to the plotly dash package. idk.

Describe your context Please provide us your environment, so we can easily reproduce the issue. windows 10, Ver 1909 Python 3.7.9

Describe the bug

A clear and concise description of what the bug is. python

import dash .... OSError: [WinError 126] The specified module could not be found

full err message below.

python Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 16:30:00) [MSC v.1900 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information.

import dash Traceback (most recent call last): File "", line 1, in File "C:\Users\bmt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\dash__init.py", line 5, in from .dash import Dash, no_update # noqa: F401,E402 File "C:\Users\bmt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\dash\dash.py", line 18, in from future.moves.urllib.parse import urlparse File "C:\Users\bmt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\future\moves__init.py", line 8, in import_top_level_modules() File "C:\Users\bmt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\future\standard_library__init.py", line 810, in import_top_level_modules with exclude_local_folder_imports(*TOP_LEVEL_MODULES): File "C:\Users\bmt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\future\standard_library__init.py", line 781, in enter module = import__(m, level=0) File "C:\Users\bmt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\test__init__.py", line 1, in import test.helpers.helpers File "C:\Users\bmt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\test\helpers\helpers.py", line 7, in from eccpy.tools import get_eccpy_module_path File "C:\Users\bmt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\eccpy\init__.py", line 1, in from eccpy.curvefit import run_curvefit File "C:\Users\bmt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\eccpy\curvefit.py", line 4, in from scipy.optimize import brentq, leastsq File "C:\Users\bmt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy\init__.py", line 136, in from . import _distributor_init File "C:\Users\bmt\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\LocalCache\local-packages\Python37\site-packages\scipy_distributor_init.py", line 61, in WinDLL(os.path.abspath(filename)) File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.7_3.7.2544.0_x64qbz5n2kfra8p0\lib\ctypes__init.py", line 364, in init__ self._handle = _dlopen(self._name, mode) OSError: [WinError 126] The specified module could not be found

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots or screen recording to help explain your problem.

------------------

more details below. pip install dash Collecting dash Using cached dash-1.19.0-py3-none-any.whl Requirement already satisfied: Flask>=1.0.4 in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from dash) (1.1.2) Requirement already satisfied: plotly in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from dash) (4.14.3) Requirement already satisfied: dash-core-components==1.15.0 in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from dash) (1.15.0) Requirement already satisfied: dash-table==4.11.2 in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from dash) (4.11.2) Requirement already satisfied: future in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from dash) (0.18.2) Requirement already satisfied: dash-renderer==1.9.0 in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from dash) (1.9.0) Requirement already satisfied: flask-compress in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from dash) (1.9.0) Requirement already satisfied: dash-html-components==1.1.2 in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from dash) (1.1.2) Requirement already satisfied: click>=5.1 in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from Flask>=1.0.4->dash) (7.1.2) Requirement already satisfied: Werkzeug>=0.15 in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from Flask>=1.0.4->dash) (1.0.1) Requirement already satisfied: itsdangerous>=0.24 in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from Flask>=1.0.4->dash) (1.1.0) Requirement already satisfied: Jinja2>=2.10.1 in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from Flask>=1.0.4->dash) (2.11.3) Requirement already satisfied: MarkupSafe>=0.23 in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from Jinja2>=2.10.1->Flask>=1.0.4->dash) (1.1.1) Requirement already satisfied: brotli in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from flask-compress->dash) (1.0.9) Requirement already satisfied: six in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from plotly->dash) (1.14.0) Requirement already satisfied: retrying>=1.3.3 in c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages (from plotly->dash) (1.3.3) Installing collected packages: dash Successfully installed dash-1.19.0

------------

pip freeze WARNING: Could not generate requirement for distribution -ip 20.2.4 (c:\users\bmt\appdata\local\packages\pythonsoftwarefoundation.python.3.7_qbz5n2kfra8p0\localcache\local-packages\python37\site-packages): Parse error at "'-ip==20.'": Expected W:(abcd...) airbnb==2.3.2 altgraph==0.17 appdirs==1.4.3 argon2-cffi==20.1.0 async-generator==1.10 asyncio==3.4.3 atomicwrites==1.4.0 attrs==20.3.0 backcall==0.2.0 beautifulsoup4==4.9.3 bleach==3.3.0 Brotli==1.0.9 bs4==0.0.1 cachetools==4.1.1 camelot-py==0.8.2 certifi==2020.4.5.1 cffi==1.14.4 chardet==3.0.4 click==7.1.2 colorama==0.4.3 comtypes==1.1.7 configparser==5.0.0 crayons==0.3.0 cryptography==3.2.1 cycler==0.10.0 dash==1.19.0 dash-core-components==1.15.0 dash-html-components==1.1.2 dash-renderer==1.9.0 dash-table==4.11.2 datefinder==0.7.1 decorator==4.4.2 defusedxml==0.6.0 distlib==0.3.0 eccpy==0.5.0 entrypoints==0.3 et-xmlfile==1.0.1 fake-useragent==0.1.11 filelock==3.0.12 Flask==1.1.2 Flask-Compress==1.9.0 free-proxy==1.0.2 future==0.18.2 gitdb==4.0.5 GitPython==3.1.2 google-api-core==1.21.0 google-api-python-client==1.9.3 google-auth==1.18.0 google-auth-httplib2==0.0.4 google-auth-oauthlib==0.4.1 googleapis-common-protos==1.52.0 gTTS==2.1.1 gTTS-token==1.1.3 html5lib==1.1 httmock==1.4.0 http-request-randomizer==1.3.2 httplib2==0.18.1 idna==2.9 importlib-metadata==1.5.2 iniconfig==1.1.1 int-date==0.1.8 ipykernel==5.4.3 ipython==7.20.0 ipython-genutils==0.2.0 itsdangerous==1.1.0 jdcal==1.4.1 jedi==0.18.0 Jinja2==2.11.3 jsonschema==3.2.0 jupyter-client==6.1.11 jupyter-core==4.7.1 jupyterlab-pygments==0.1.2 kiwisolver==1.3.1 lxml==4.5.1 MarkupSafe==1.1.1 matplotlib==3.3.3 mistune==0.8.4 multitasking==0.0.9 nbclient==0.5.2 nbconvert==6.0.7 nbformat==5.1.2 nest-asyncio==1.5.1 notebook==6.2.0 numpy==1.18.3 oauth==1.0.1 oauthlib==3.1.0 opencv-python==4.4.0.46 openpyxl==3.0.5 packaging==20.8 pandas==1.0.3 pandocfilters==1.4.3 parso==0.8.1 pdfminer.six==20201018 pdfminer3==2018.12.3.0 pefile==2019.4.18 pickleshare==0.7.5 Pillow==8.0.1 playsound==1.2.2 plotly==4.14.3 pluggy==0.13.1 prometheus-client==0.9.0 prompt-toolkit==3.0.16 protobuf==3.12.2 psutil==5.7.2 py==1.10.0 pyasn1==0.4.8 pyasn1-modules==0.2.8 pycparser==2.20 pycryptodome==3.9.9 pyee==7.0.2 pygame==1.9.6 Pygments==2.8.0 pyinstaller==4.0 pyinstaller-hooks-contrib==2020.7 pyOpenSSL==20.0.1 pyparsing==2.4.7 PyPDF2==1.26.0 pypiwin32==223 pyppeteer==0.2.2 pyppeteer-stealth==1.0.0 pyrsistent==0.17.3 PySocks==1.7.1 pytest==6.2.1 python-dateutil==2.8.1 pyttsx3==2.90 pytz==2019.3 pywin32==300 pywin32-ctypes==0.2.0 pywinpty==0.5.7 pyzmq==22.0.3 regex==2020.11.13 requests==2.25.1 requests-oauthlib==1.3.0 retrying==1.3.3 rsa==4.6 scipy==1.5.4 selenium==3.141.0 Send2Trash==1.5.0 six==1.14.0 smartystreets-python-sdk==4.7.3 smmap==3.0.4 sortedcontainers==2.3.0 soupsieve==2.0.1 stock-pandas==0.25.3 stockstats==0.3.1 terminado==0.9.2 testpath==0.4.4 TikTokApi==3.1.1 toml==0.10.2 tornado==6.1 tqdm==4.46.0 traitlets==5.0.5 tulipy==0.4.0 tweepy==3.10.0 uritemplate==3.0.1 urllib3==1.25.9 usps-api==0.5 virtualenv==20.0.14 wcwidth==0.2.5 webdriver-manager==2.5.1 webencodings==0.5.1 websockets==8.1 Werkzeug==1.0.1 xlrd==1.2.0 xmltodict==0.12.0 yahoofinancials==1.5 yfinance==0.1.54 youtube-dl==2020.12.22 zipp==3.1.0

------------

aspiringguru commented 3 years ago

as per notes, this is solved by using virtual environment. problem is in corrupted base install of python