question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

python-docx package successfully installed, but I can't find it and can't access it via import docx

See original GitHub issue

I have installed latest version of pip and python-docx on my mac, however, docx module isn’t listed in the lib --> site-packages folder. Would someone tell me why I can find the that module? When I try to import the docx module in a file, it’s not there. I’m using Python 3.7, Pycharm 2018, mac 10.13.4

pip install python-docx --user Collecting python-docx Requirement already satisfied: lxml>=2.3.2 in /Library/Python/2.7/site-packages (from python-docx) (4.2.3) matplotlib 1.3.1 requires nose, which is not installed. matplotlib 1.3.1 requires tornado, which is not installed. Installing collected packages: python-docx Successfully installed python-docx-0.8.6 $ pip --version pip 10.0.1 from /Library/Python/2.7/site-packages/pip (python 2.7)

image

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
derfalxcommented, May 15, 2019

I have resolved the problem in my case and it was not a problem of PyCharm itself. Accidentally I’ve been using a pre-release version of python. Switching to a release version solved the problem.

0reactions
rahulvaradkarcommented, Jul 22, 2020

Hello joem76, I had same problem on my laptop. And I could fix it be referring to following link shared in your post. It worked.

https://stackoverflow.com/questions/26069254/importerror-no-module-named-bottle-pycharm

The reason was I installed several Python Editors, Clients like PyCharm, Anaconda and due that several copies of python.exe were present on my local drive.

PyCharm has option to compile code using the specific pythone.exe present on your local drive. In my case I selected the correct python.exe and all errors were gone.

This is similar situation in Java environment where you have several JDKs on your machine and you need to choose the correct and compatible one to compile your code without errors.

Thanks evreryone for their contribution to fix this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I getting a ModuleNotFoundError trying to import ...
python -docx seems like the perfect solution, but it throws a ModuleNotFoundError even after an apparently successful install. I use anaconda, so ...
Read more >
python-docx not working 'ModuleNotFound' : Forums
No problem, installed successfully. Tried to import it as suggest in the documentation and I keep getting this error. ModuleNotFoundError: ...
Read more >
Can't import docx after installing 0.8.5
I uninstalled a previous version of python-docx successfully. I tried pip install python-docx, and it downloaded lxml 3.4.4 and python-docx 0.8.
Read more >
Welcome to python-docx-template's documentation! — python ...
To install using pip: pip install docxtpl. or using conda: conda install docxtpl --channel conda-forge. Usage: from docxtpl import DocxTemplate doc ...
Read more >
Chapter 13 – Working with PDF and Word Documents
This chapter will cover two such modules: PyPDF2 and Python-Docx. ... If the module was installed correctly, running import PyPDF2 in the interactive...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found