# Struggling to build Python on Windows 10

**URL:** <https://discuss.python.org/t/struggling-to-build-python-on-windows-10/11031>\
**Category:** Core Workflow\
**Created:** [October 8, 2021, 1:57pm UTC](https://discuss.python.org/t/struggling-to-build-python-on-windows-10/11031 "2021-10-08T13:57:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexWaygood](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/alexwaygood/32/4722_2.png) [@AlexWaygood](https://discuss.python.org/u/AlexWaygood)\
**Post date:** [October 8, 2021, 1:57pm UTC](https://discuss.python.org/t/struggling-to-build-python-on-windows-10/11031/1 "2021-10-08T13:57:33Z")

</div>

Hi all,

I’m struggling to build Python 3.11 alpha 0 from source on Windows 10.

Steps I have taken:

- Successfully installed Microsoft Visual Studio.
- Successfully Installed git on my machine.
- Successfully forked the CPython main branch on GitHub.
- Successfully cloned my forked branch onto my local machine.
- Navigated to the cpython repo folder on the command line.
- Ran `PCbuild\build.bat -e -d -p x64`

The error I receive is:

```
Build FAILED.

LINK : fatal error LNK1104: cannot open file 'libffi-7.lib' [C:\Users\Alex\Desktop\Code dump\cpython\PCbuild\_ctypes.vcxproj]
    0 Warning(s)
    1 Error(s)

```

This appears to be the only error that takes place during the build process; the rest of the build works fine. It appears as though there is no file on my PC named `libffi-7.lib`. It _does_ appear as though I have several files named `libffi-8.lib`. These can be found in the following locations:

- cpython\externals\libffi\amd64
- cpython\externals\libffi\arm32
- cpython\externals\libffi\arm64
- cpython\externals\libffi\win32

I am using the following hardware and software versions:

- Microsoft Windows 10 Home, Version 10.0.19043 Build 19043
- A x64-based PC
- An HP Pavilion Notebook laptop
- Processor AMD A8-7410 APU
- git version 2.24.1.windows.2
- Microsoft Visual Studio 2017.
- The build appears to be using an installed copy of Python 3.8 on my machine, which was installed with Conda.
- The build informs me it is `Using "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe" (found in the Visual Studio installation)`

Variations on the build command I have tried, that have had no effect on the problem:

- I initially tried building Python with Visual Studio 2019, and received the same error message. I then uninstalled Visual Studio 2019, installed Visual Studio 2017, and tried again. This had no effect on the error message that I received.
- I tried running `PCbuild\build.bat -E -d -p x64` instead of `PCbuild\build.bat -e -d -p x64`. This made no difference; the build failed in the same way, although I did get an additional warning informing me that `Not including zlib is not a supported configuration.`
- I tried deleting the local copy of my forked branch and re-cloning it. This made no difference.
- I tried enabling the `.NET Framework 3.5 (includes .NET 2.0 and 3.0)` on my machine. This made no difference.
- I tried restarting my computer. This made no difference.

Does anyone have any ideas as to what might be going wrong and/or how to fix it?

---

<div class="post-metadata">

**Author:** ![malemburg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/malemburg/32/50_2.png) [@malemburg](https://discuss.python.org/u/malemburg)\
**Post date:** [October 8, 2021, 2:23pm UTC](https://discuss.python.org/t/struggling-to-build-python-on-windows-10/11031/2 "2021-10-08T14:23:26Z")

</div>

libffi-7 is used in Python 3.10. Python 3.11 uses libffi-8.

Are you sure you forked / cloned the right branch ?

---

<div class="post-metadata">

**Author:** ![AlexWaygood](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/alexwaygood/32/4722_2.png) [@AlexWaygood](https://discuss.python.org/u/AlexWaygood)\
**Post date:** [October 8, 2021, 2:58pm UTC](https://discuss.python.org/t/struggling-to-build-python-on-windows-10/11031/3 "2021-10-08T14:58:05Z")

</div>

Thanks so much! I can confirm I forked and cloned the main branch (and did both yesterday), and that my forked branch was Python 3.11 alpha 0. However, your comment led me to notice that, for some reason, my forked branch said that it was around 500 commits behind `cpython/main`. After fetching and merging from `cpython/main` and then recloning my branch, my build was successful.

---

<div class="post-metadata">

**Author:** ![malemburg](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/malemburg/32/50_2.png) [@malemburg](https://discuss.python.org/u/malemburg)\
**Post date:** [October 9, 2021, 10:50am UTC](https://discuss.python.org/t/struggling-to-build-python-on-windows-10/11031/4 "2021-10-09T10:50:35Z")

</div>

Great that you resolved the issue.

---

<div class="post-metadata">

**Author:** ![davidism](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/davidism/32/3295_2.png) [@davidism](https://discuss.python.org/u/davidism)\
**Post date:** [January 20, 2024, 8:29pm UTC](https://discuss.python.org/t/struggling-to-build-python-on-windows-10/11031/5 "2024-01-20T20:29:57Z")

</div>

A post was split to a new topic: [Where to download Python 3.10 alpha 1](https://discuss.python.org/t/where-to-download-python-3-10-alpha-1/43710)
