0

When I run a script in Anaconda Prompt, it works fine.

When I try to run it via PyCharm, I get this error related to the import of pandas.

C:\ProgramData\Anaconda3\python.exe C:/Users/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py
Traceback (most recent call last):
  File "C:/Users/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py", line 2, in <module>
    import pandas as pd
  File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\__init__.py", line 19, in <module>
    "Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']

Process finished with exit code 1

If I try to import numpy and run it via PyCharm I get:

C:\ProgramData\Anaconda3\python.exe C:/Users/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
    from . import multiarray
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/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py", line 2, in <module>
    import numpy as np
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\__init__.py", line 142, in <module>
    from . import add_newdocs
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
    from .type_check import *
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
    raise ImportError(msg)
ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: DLL load failed: The specified module could not be found.


Process finished with exit code 1

Running the same script in Anaconda prompt...no problem

My run configuration in PyCharm uses the Anaconda python distribution?

enter image description here

It should be noted that I am not using envirnoments, just the base Anaconda installation. More worryingly I dont see ANY Conda options in the project settings in PyCharm which a lot of tutorials seem to allude to.

smackenzie
  • 2,880
  • 7
  • 46
  • 99
  • https://stackoverflow.com/questions/42746732/use-conda-environment-in-pycharm – Roland Weber Jul 12 '19 at 10:34
  • Possible duplicate of [Use Conda environment in pycharm](https://stackoverflow.com/questions/42746732/use-conda-environment-in-pycharm) – Roland Weber Jul 12 '19 at 10:35
  • Possible duplicate of [Error importing numpy from Anaconda, using conda (DLL load failed: The specified module could not be found)](https://stackoverflow.com/questions/52672463/error-importing-numpy-from-anaconda-using-conda-dll-load-failed-the-specified) – Psychotechnopath Jul 12 '19 at 11:19
  • I am not using environments, just the based python environment. This has never been an issue before, just suddenly appeared. @RolandWeber – smackenzie Jul 12 '19 at 13:56
  • Which PyCharm version do you use? – Pavel Karateev Jul 15 '19 at 15:13

1 Answers1

0

Seems like a problem with the path for your scripts. Are you sure You have included your scripts in the PATH variable? If so are you sure your libraries are downloading/installing in that path?

Moeed
  • 3
  • 6
  • what does a path have to do with it, if I am running the script directly from within PyCharm. Anaconda is set as the distirbution to use, although I am not using conda environments, just the base environment, – smackenzie Jul 12 '19 at 13:55