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:
- your Python installation is broken, which is not the case here as you mentioned other packages working, or that
- Quandl imports some broken dependency.
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
.
PyPI wheels
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.
third-party wheels
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
building from source dist
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.
quandl
s source code, it's pure python - are you sure it'squandl
and not some dependency? Can you at least tryimport numpy, pandas
first to see if those work? – Incommodepandas
without getting an access violation, surely its installation is borked - did you install from wheel or source dist? What's your platform/ABI tag? (If you need commands to find them out, check my other answer).pandas
has C extensions that are compiled to shared objects, so if done wrong, the installed files turn unusable. – Incommode