# Docker Python - Module not Found after installing

**URL:** <https://forums.docker.com/t/docker-python-module-not-found-after-installing/89211>\
**Category:** Docker Hub\
**Created:** [February 18, 2020, 4:04pm UTC](https://forums.docker.com/t/docker-python-module-not-found-after-installing/89211 "2020-02-18T16:04:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![iwcoetzer](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/iwcoetzer/32/26550_2.png) [@iwcoetzer](https://forums.docker.com/u/iwcoetzer)\
**Post date:** [February 18, 2020, 4:04pm UTC](https://forums.docker.com/t/docker-python-module-not-found-after-installing/89211/1 "2020-02-18T16:04:48Z")

</div>

Hello

I am trying to compile a python script using my Docker container.

When I install a new library in the Docker container:

1. I install it using the docker container’s command line:  
pip install openpyxl  
it installs succesfully

2. but when i try and compile a python script using the same docker container i receive this error: from openpyxl import load\_workbook  
ImportError: No module named ‘openpyxl’

---

<div class="post-metadata">

**Author:** ![iwcoetzer](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/iwcoetzer/32/26550_2.png) [@iwcoetzer](https://forums.docker.com/u/iwcoetzer)\
**Post date:** [February 18, 2020, 4:24pm UTC](https://forums.docker.com/t/docker-python-module-not-found-after-installing/89211/2 "2020-02-18T16:24:49Z")

</div>

Ha! solved my own problem … I had to select a specific ‘version’ of python in Visual Studio Code …  
for some reason i had two python versions installed on the docker container… pip install installed the library to the latest on - after picking that one it worked 100%…

---

<div class="post-metadata">

**Author:** ![joshbutleruk](https://sea3.discourse-cdn.com/docker/user_avatar/forums.docker.com/joshbutleruk/32/36060_2.png) [@joshbutleruk](https://forums.docker.com/u/joshbutleruk)\
**Post date:** [August 25, 2022, 10:29pm UTC](https://forums.docker.com/t/docker-python-module-not-found-after-installing/89211/3 "2022-08-25T22:29:24Z")

</div>

@iwcoetzer thanks for echoing your solution - just spent ages trying to work out why I kept getting ImportError!  
Turns out same thing - multiple versions of python… forcing to Python3 fixed it.
