# Windows: Python, \`pip\` module not found?

**URL:** <https://travis-ci.community/t/windows-python-pip-module-not-found/5480>\
**Category:** Windows\
**Tags:** python\
**Created:** [October 15, 2019, 9:38pm UTC](https://travis-ci.community/t/windows-python-pip-module-not-found/5480 "2019-10-15T21:38:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![goodboy](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/goodboy/32/2905_2.png) [@goodboy](https://travis-ci.community/u/goodboy)\
**Post date:** [October 15, 2019, 9:38pm UTC](https://travis-ci.community/t/windows-python-pip-module-not-found/5480/1 "2019-10-15T21:38:28Z")

</div>

Heads up I’m not a Windows user by any means so could be totally lost here.

Here is an example build that demonstrates the issue:  
[https://travis-ci.org/goodboy/tractor/jobs/597972125](https://travis-ci.org/goodboy/tractor/jobs/597972125)

This [yaml setup](https://github.com/goodboy/tractor/blob/master/.travis.yml#L5) used to work just fine like a day ago?

It also appears [I’m not the only one seeing this](https://travis-ci.com/WeblateOrg/translation-finder/jobs/245792020).

I tried adding `python -m ensurepip` to the `before_install` steps and got this [failed build](https://travis-ci.org/goodboy/tractor/jobs/598285903) instead.

Not sure what else I’m missing at this point. `pip` seems like a pretty key package that used to work just fine on these images.

---

<div class="post-metadata">

**Author:** ![goodboy](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/goodboy/32/2905_2.png) [@goodboy](https://travis-ci.community/u/goodboy)\
**Post date:** [October 15, 2019, 10:00pm UTC](https://travis-ci.community/t/windows-python-pip-module-not-found/5480/2 "2019-10-15T22:00:12Z")

</div>

Looks like this is something to do with trying to use a specific version of Python (was trying to force 3.7 but 3.8 [latest] seems to be getting installed)?

It’s odd because [the docs on this](https://docs.travis-ci.com/user/languages/python/#running-python-tests-on-multiple-operating-systems) seem to suggest that what I am doing is ok?

Seems to work once I don’t hardcode the version into the Python path being used but then the tests run on 3.8 which is not desired (yet).

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [October 16, 2019, 3:25am UTC](https://travis-ci.community/t/windows-python-pip-module-not-found/5480/3 "2019-10-16T03:25:20Z")

</div>

You can force a specific version with `choco install --version`:

```auto
choco install python --version 3.7.5

```

The example in the docs is not bulletproof. It worked when it was written and 3.8 was released 2 days ago. You can suggest an improvement using the “Improve this page on Github” button.

---

<div class="post-metadata">

**Author:** ![YakDriver](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/yakdriver/32/1073_2.png) [@YakDriver](https://travis-ci.community/u/YakDriver)\
**Post date:** [October 16, 2019, 8:22pm UTC](https://travis-ci.community/t/windows-python-pip-module-not-found/5480/4 "2019-10-16T20:22:33Z")

</div>

> [@native-api](#):
>
> ```
> choco install python --version 3.7.5
> 
> ```

Today you’ll get an error from 3.7.5 (which came out on 10/15/19). Might work tomorrow. 3.7.4 will work though.

You _can_ use 3.8 pretty easily without `refreshenv`. Set an env with the 3.8 PATH:

```
os: windows
language: shell
env: PATH=/c/Python38:/c/Python38/Scripts:$PATH
before_install:
- choco install python
- python -m pip install -r requirements/ci.txt

```

---

<div class="post-metadata">

**Author:** ![goodboy](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/goodboy/32/2905_2.png) [@goodboy](https://travis-ci.community/u/goodboy)\
**Post date:** [October 17, 2019, 12:17am UTC](https://travis-ci.community/t/windows-python-pip-module-not-found/5480/5 "2019-10-17T00:17:54Z")

</div>

Sweet thanks for the tip on running 3.7 @YakDriver and @native-api.

I actually just made [one job run whatever is latest python `3.x`](https://github.com/goodboy/tractor/blob/windows_support/.travis.yml#L7) which avoids hard coding any `$PATH` stuff afaict.

I’m gonna try the `--version` flag to `choco` and see what I get for keeping a 3.7 run on windows.

---

<div class="post-metadata">

**Author:** ![goodboy](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/goodboy/32/2905_2.png) [@goodboy](https://travis-ci.community/u/goodboy)\
**Post date:** [October 17, 2019, 1:28am UTC](https://travis-ci.community/t/windows-python-pip-module-not-found/5480/6 "2019-10-17T01:28:43Z")

</div>

For the extra lolz, apparently `choco install python` versus `python3` matters:

with just `python` it’s rekt:  
[https://travis-ci.org/goodboy/tractor/builds/598943087](https://travis-ci.org/goodboy/tractor/builds/598943087)

versus with `python3` everything’s fine:  
[https://travis-ci.org/goodboy/tractor/builds/598939313](https://travis-ci.org/goodboy/tractor/builds/598939313)

Check the configs; that’s the only difference.

---

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [October 17, 2019, 2:01am UTC](https://travis-ci.community/t/windows-python-pip-module-not-found/5480/7 "2019-10-17T02:01:55Z")

</div>

> [@YakDriver](#):
>
> Today you’ll get an error from 3.7.5 (which came out on 10/15/19).

Note that I wrote `python`, not `python3`. These are different packages and for `python`, 3.7.5 is already available. Check available versions with `choco list -e -a <package name>`.

> [@goodboy](#):
>
> with just `python` it’s rekt:  
> [Travis CI - Test and Deploy with Confidence](https://travis-ci.org/goodboy/tractor/builds/598943087)
> 
> versus with `python3` everything’s fine:  
> [Travis CI - Test and Deploy with Confidence](https://travis-ci.org/goodboy/tractor/builds/598939313)

The logs show that `python3` always installs to `C:\Python` while `python` installs to `C:\PythonXY`.

---

<div class="post-metadata">

**Author:** ![YakDriver](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/yakdriver/32/1073_2.png) [@YakDriver](https://travis-ci.community/u/YakDriver)\
**Post date:** [October 17, 2019, 6:26pm UTC](https://travis-ci.community/t/windows-python-pip-module-not-found/5480/8 "2019-10-17T18:26:57Z")

</div>

That’s good information. Thanks!

Summary, `choco install python` vs. `choco install python3`:

**`python`**

- New versions might be available sooner (or at least different times than `python3`)
- Installs Python to `C:\PythonXY`
- Requires either `refreshenv` or setting `PATH` (or using full path in using Pip and Python)

**`python3`**

- New versions might be available later (or at least different times than `python`)
- Installs Python to `C:\Python`
- Requires either `refreshenv` or setting `PATH` (or using full path in using Pip and Python)

---

<div class="post-metadata">

**Author:** ![rchateauneu](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/rchateauneu/32/2730_2.png) [@rchateauneu](https://travis-ci.community/u/rchateauneu)\
**Post date:** [June 12, 2021, 9:42pm UTC](https://travis-ci.community/t/windows-python-pip-module-not-found/5480/9 "2021-06-12T21:42:10Z")

</div>

Exactly the same problem but two years later. These commands used to work on Windows this morning, and now not anymore:

choco install python --version 3.7.5  
python -m ensurepip  
python -m pip install --upgrade pip

Now the last command fails with the error message:  
No module named pip
