-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Miniconda3. ImportError: Unable to import required dependencies... #6843
Comments
The problem is that when choosing a virtual conda environment, this environment is not activated. To fix the problem, you must manually execute activate myenv (myenv is the environment name) in the VS code terminal. |
Yes, specifying Path for conda is necessary. But in other IDEs it works without environment variables. Still, this is a problem with VS code or the Python extension package for Visual Studio Code |
Thanks for letting us know about this, @PavelD0770. Before we take a deeper look, it looks like you are trying to use conda and virtualenv together. Is that the case? If so, why? Using conda alone should be sufficient. Keep in mind that the extension expects one or the other, not both. |
This comment has been minimized.
This comment has been minimized.
(The previous message did not finish. Accidentally sent is not complete.)
At first I only used Python 3 without virtual environments to learn this language. Later I started to study Python course for data analysis. For this I installed Miniconda3. I created the conda virtual environment in order to gain new skills.
And to my experiments and test tasks on the course program to perform separately. For the course I used Jupyter Notebook, and for my experiments - MS Visual Studio Code (VS Code I really liked). For everything to work, I added the path to Miniconda to the Path environment variable. I didn't add anything to VS code settings. Only as a terminal chose cmd. Everything worked.
At what point VS Code began to "sweat" at the panda and numpy can not say for sure. I first thought this happened after installing the Anaconda extension package for VS Code. Deleted - did not help. I reviewed the possible settings, but nothing helped.
Helped only run the conda "activate myenv"command in vs code terminal. The script is started without any errors. I tried to install Python on another PC, then Miniconda, then envs. The mistake was repeated. The solution is also "activate myenv".
It looks like something with envs conda activation. MS Visual Studio Code extension to Python and PyCharm JetBrains in this environment are working without problems (from conda, with conda envs, c, Python, c Python virtualenv) Now I uninstalled Miniconda (not really necessary), I use only Python and virtualenv (configured for all the necessary tasks right now). It's okay!
|
So you are saying that everything is fine now that you have uninstalled miniconda? |
This comment has been minimized.
This comment has been minimized.
@meastream, for conda activation happening after the debugger starts, that is a known issue (see #6010 and #7425). For the other problems, please create a new issue. |
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on then we will be happy to re-open this issue to pick up where we left off. |
C:\Users\user>C:/Python/Miniconda3/envs/myenv/python.exe d:/Test/Test.py
Traceback (most recent call last):
File "d:/Test/Test.py", line 1, in import pandas
File "C:\Python\Miniconda3\envs\myenv\lib\site-ackages\pandas_init_.py", line 17, in "Unable to import required dependencies:\n" + "\n".join(missing_dependencies)
ImportError: Unable to import required dependencies:
numpy: DLL load failed: The specified module was not found.
Install Miniconda3
I create myenv virtual environment in Miniconda3
Download packages there: pandas, numpy, etc.
Launch VS Code (Microsoft's Python extension installed)
I create a Python script file with text (for example):
import pandas
print ('pass ..')
I select the virtual environment myenv and run the script on
performance.
I observe the above error :(
Works from the console (miniconda), works from Visual Studio 2019, works from Pycharm too. From VS Code, it only works when changing to the virtual environment (venv) of Python 3.7, in which the packages from p. 3 are also installed. Those. the only problem is a bunch of VS Code and Miniconda3.
A similar problem with numpy, matplotlib, scipy. C, for example, sqlalchemy, requests and some other third-party packages are all OK.
Previously, VS code worked with the Miniconda3 virtual environment without any problems. Perhaps the problem appeared after installing and then uninstalling Anaconda Extension Pack.
Python 3.7.4
Miniconda3 4.7.10 (Python 3.7.3)
Virtual env.: virtualenv (Python 3.7.4), conda envs. (Python 3.7.3)
VS Code version: Code 1.36.1 (2213894, 2019-07-08T22:59:35.033Z)
MS Python extension for Visual Studio Code 2019.6.24221
OS version: Windows_NT x64 10.0.17134
System Info
CPUs Intel(R) Core(TM) i3-7100U CPU @ 2.40GHz (4 x 2400)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 5.89GB (0.37GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (3):
vscode-language-pack-ru MS- 1.37.3
python ms- 2019.6.24221
material-icon-theme PKi 3.8.1
The text was updated successfully, but these errors were encountered: