Here is my entire program:
import quandl
print("Hello World");
which results in:
Process finished with exit code -1073741819 (0xC0000005)
In the first place I imported Quandl, but then I received:
ModuleNotFoundError: No module named 'Quandl'
and then I googled it and read a suggestion to change the name to quandl.
I have installed the package in the project intercepter, there it's named Quandl though. Anyway, it looks like at least with the lower case it passes the compilation.
I run my program on Windows 10. My Python version is 3.7. I use PyCharm.
If I try to import a different package, then it works. Quandl is the problematic one.
Quandl is a pure Python distribution (containing only Python code), so when you get an access violation error on import quandl
, it can either mean that:
In your case, it's pandas
causing the issue. First of all, check what platform/ABI tags pip
reports on your machine:
pip<10
:
$ python -c "import pip; print(pip.pep425tags.get_impl_tag())"
$ python -c "import pip; print(pip.pep425tags.get_abi_tag())"
$ python -c "import pip; print(pip.pep425tags.get_platform())"
pip>=10
:
$ python -c "import pip._internal as pip; print(pip.pep425tags.get_impl_tag())"
$ python -c "import pip._internal as pip; print(pip.pep425tags.get_abi_tag())"
$ python -c "import pip._internal as pip; print(pip.pep425tags.get_platform())"
Be sure to use the correct Python version if you have multiple installed (version check with python --version
); replace python
with py -2
or py -3
if necessary.
The impl tag is an abbreviation for your Python implementation, usually CPython; for example, cp35
means CPython of major version 3.5 etc. The ABI tag consists of three parts: Python implementation abbreviation, impl version (same as in Python tag) plus the ABI flags (for example, m
if your Python impl was built with --with-pymalloc
etc). You platform should be either win_amd64
for 64 bit Windows, or win32
for 32 bit one.
Now check if there is a wheel with precompiled extensions available for your platform: go to https://pypi.org/project/pandas/#files and browse through the list of files. Look for a file pandas-0.23.4-{impl tag}-{ABI tag}-{platform tag}.whl
.
If there is a wheel file suitable for your current platform, copy its link and run:
$ pip uninstall -y pandas
$ pip install https://copied-link-to-wheel-file
If pip uninstall
fails, run
$ pip install --force-reinstall https://copied-link-to-wheel-file
instead.
If no wheel is available from PyPI, you may look for other wheel sources; often https://www.lfd.uci.edu/~gohlke/pythonlibs contains prebuilt wheels for Windows. Check out the list of pandas
wheels available there. If a wheel matches your platform, download it and run
$ pip uninstall -y pandas
$ pip install c:/path/to/downloaded/wheel/file.whl
If no wheels are available for your platform, you have to build pandas
from source. In this case, you need to install a C compiler (Visual C++ build tools on Windows) and run:
$ pip uninstall -y pandas
$ pip install pandas --verbose --no-cache-dir --no-binary=pandas --global-option="--inplace"
Be sure to install the correct Visual C++ build tools, for example, Python 3.7 requires the 2017 version, while Python 3.4/3.5/3.6 require the 2015 version. Also, make sure you have a recent setuptools
version; upgrade if necessary:
$ pip install --upgrade setuptools
It may be wise to copy and store the build log if you encounter any problems after installation, you may get a clue from warnings emitted on build.
Now install pytest
and run the tests to validate the installation:
$ pip install pytest
$ python -c "import pandas; pandas.test()"
If the tests fail and you downloaded the wheel from PyPI, open a new issue in pandas
' Github repo as the wheel should be supported on your platform, but is isn't. In both other cases (installing third-party wheels or building from source), you're on your own. If you're building from source, ask another question here, providing the full build log.
You Probably have not installed the Quandl package properly. Because I've tried it in Juypter Notebook before installation it gives me the same error that you are getting.
But after installing the package it works fine.
Please see the attached screenshot.
Incase of command line installation please type the following command:
pip install quandl
If it gives the pip installation then first you need to install pip.
Well, I use Quandl with Canopy and Anaconda (Windows and Mac) and never had any kind of problem at all. Sorry I did not see that you had already installed.
But on the other hand, I had some troubles using pip when I did not run it as administrator - sometimes it said that the package was installed but it was not.
if you install quandl sucessfully, then check where it installed. Generally, default library resides in
your installed python directory/lib, , in my case C:/Program Files (x86)/Python37-32/lib
and pip installs third party packages into
(your python dir/lib/site-packages, in my case C:/Program Files (x86)/Python37-32/lib/site-packages
you should be able to find quandl packages there, if not then you did not installed it correctly. And if you use pip in a venv(i.e, VirtualEnv- find more about venv at https://docs.python.org/3/tutorial/venv.html and pycharm uses venv by default, you'll find the library in (your project location)/venv/lib/site-packages, which in my case, C:/Users/user/Documents/PyProject1/venv/lib/site-packages, you'll definitely find your quandl packages there too; if not you need to re-install it. Python import mechanism is,
it always tries find modules into your code file home directory, PYTHONPATH, standard library directories, site-packages directory, .pth files, by default. you can see the path by the following command,
import sys
print(sys.path)
then you can check the paths, check for quadl installation dir, if it's not in site-packages as mentioned earlier(which may be an exception and installation fault), update it. check PYTHONPATH in Windows
If you use pycharm then when you create a project, expand the
project Interpreter:new virtual environment, then check inherit global site-packages, then pycharm automatically import third party packages into venv site-packages.
and also you need to install anything using pip with administrator privileges in windows, otherwise pip'll not install packages correctly. Hope this helps
User contributions licensed under CC BY-SA 3.0