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.

Problems getting started on Windows 10 (WAS: Why is Copier not running with pipx's python?)

See original GitHub issue

First time user on Windows 10 here. I installed copier using pipx according to the instructions. I did not expect courier to fail based on the fact that Python is not in my PATH. I assumed courier would be supplied with Python from within pipx…

If this is intentionally, I’m curious of the reason. Or perhaps this is a template specific thing? If so, are there any basic “poetry-based” templates available I could start with?

PS C:\proj\python> pipx install copier
  installed package copier 5.1.0, Python 3.9.1
  These apps are now globally available
    - copier.exe
PS C:\proj\python> copier "gh:pawamoy/copier-poetry" firstProject
...
    create  tests\__init__.py

 > Running task 1 of 1: python scripts/post_generation.py
'python' is not recognized as an internal or external command,
operable program or batch file.
...

I keep my python virtual environments in the project directory, so this looks like a chicken and the egg problem to me… 😉

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pawamoycommented, Jan 13, 2021

Note that I purposely don’t have Python in my PATH, since I use a pipx installed poetry and keep my virtual environments inside my project directories.

I fail to see how this relates? You can totally have Python in your PATH and still use pipx and tools installed with pipx normally. pipx does not replace Python (nor does it provide it), it uses it to isolate tools. You can use both simultaneously.

For now I went with solution 3, by creating and activating a virtual environment and my firstProject was created successfully. 😃

Solution 3 was about setting your PATH variable to include your system/user-account Python executable directory. Did you add the virtualenv Scripts directory instead?

However, now I have the same questions about make, is it a mandatory requirement I missed?

It is not. In my copier-poetry template, make is just a helper. Anything you can call with make TASK ARG=VALUE, you can also call with poetry run duty TASK ARG=VALUE. See Tasks. And yeah, no make on Windows, unless you want to try the Mingw32 version through Conda or Chocolatey. I do not explicitly support Windows in my template.

I got the impression that copier would work on Windows, but perhaps not out-of-the-box 😉

It should work indeed, but some things can break. Check out the test suite: some tests are marked as “OK to fail”. @Yajo spent many hours improving the test suite for Windows, but sometimes Windows won’t help 😕

1reaction
Cecroncommented, Jan 13, 2021

Note that I purposely don’t have Python in my PATH, since I use a pipx installed poetry and keep my virtual environments inside my project directories.

For now I went with solution 3, by creating and activating a virtual environment and my firstProject was created successfully. 😃

However, now I have the same questions about make, is it a mandatory requirement I missed? (Sphinx e.g. is supplying a make.bat for the Windows platform.) I do have git installed and in the path, but that is not shipped with make. 😦

PS C:\proj\python\copier> py -3 -m venv --prompt . .venv
PS C:\proj\python\copier> .\.venv\Scripts\Activate.ps1
(copier) PS C:\proj\python\copier> copier "gh:pawamoy/copier-poetry" firstProject
...
 > Running task 1 of 1: python scripts/post_generation.py
Project sucessfully generated!
Run `make` to show the available actions.

(copier) PS C:\proj\python\copier> make
make : The term 'make' is not recognized as the name of a cmdlet, function, script file, or operable program.

Thanks for helping me out. I heard about copier and really like the fact that it seems to handle more than just the initial template creation. I got the impression that copier would work on Windows, but perhaps not out-of-the-box 😉

Perhaps I should have created a new issue, but I opted for editing the title for this one instead in order to minimize issue pollution 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

pip not working in Python Installation in Windows 10
I finally realized that pip commands are properly recognized outside of the python.exe, because pip is a separate executable. So, just open a...
Read more >
How to Install Pip on Windows - ActiveState
Adding PIP to Windows Environment Variables ... One of the most common problems with running Python tools like pip is the “not on...
Read more >
Stop struggling with Python on Windows
To show you how hard getting Python running can be on Windows. ... If there is no Conda package, try pip, and then...
Read more >
Pip Command Not Found on Windows: A Guide | Built In
A “pip: command not found” error occurs when you haven't properly installed the package installer for Python (pip) on your computer.
Read more >
How to Install PIP for Python on Windows - Liquid Web
Open a command prompt and navigate to the folder containing the get-pip.py installer. Run the following command: python get-pip.py. Pip should ...
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