This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python Launcher is sorry to say... No pyvenv.cfg file
Type: behavior Stage:
Components: Windows Versions: Python 3.8
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Packhash, eryksun, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2020-07-22 03:28 by Packhash, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
screenshot.png Packhash, 2020-07-22 17:02
Messages (7)
msg374083 - (view) Author: Chuck (Packhash) Date: 2020-07-22 03:28
on Windows 10 64 after install of Python 3.8.5 and after install of decrypt_bitcoinj_seed.pyw <--- and after double click, I get "Python Launcher is sorry to say... No pyvenv.cfg file".  I have tried multiple reinstalls of Python to no avail. When a search is performed on the entire C:\ drive, no pyvenv.cfg file is present so c:\>python -m venv myenv c:\path\to\myenv does not create the pyvenv.cfg file.  The Python Script requires PIP (Google Protobuf and pylibscrypt) and I understand it's included in 3.8.5. Please provide step by step instructions for how to either create or download the pyvenv.cfg file and the exact Python path to folder name it needs to go so I can overcome this error. Or if someone has a different solution, that's fine too... I just need the decrypt_bitcoinj_seed.pyw to work.
msg374092 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2020-07-22 11:37
It seems like you're trying to launch the python.exe that is created for a virtual environment rather than the actual one. This probably means that at some point you created a virtual environment and updated your file association to launch it.

The best thing to do is to right-click your .pyw file, choose "Open With", "Choose another app", enable "Always open ..." and choose "Python" from its list (the icon should have a space shuttle being launched). That will switch you back to the original file association.
msg374094 - (view) Author: Chuck (Packhash) Date: 2020-07-22 15:38
Mr. Dower, I apologize for not being more specific... since this is Windows based and not console driven, the file used for execution should be pythonw.exe according to the instructions at https://github.com/gurnec/decrypt_bitcoinj_seed so I right clicked on decrypt_bitcoinj_seed.pyw and went to properties and changed it's association to pythonw.exe so it would run in a non-console manner.  After doing this however, it still didn't work with the error "No pyvenv.cfg file".  Would I still follow your instructions, choosing Python instead of pythonw.exe?  Do you happen to know why the pyvenv.cfg never got created in the first place?  After all, when I do a search it's no where to be found on my C: drive.
msg374097 - (view) Author: Chuck (Packhash) Date: 2020-07-22 17:02
Does anyone know why when Python Launcher is executed by double clicking on the Python script called ecrypt_bitcoinj_seed.pyw a small window pops of stating... "Python Launcher is sorry to say... No pyvenv.cfg file" as in the image? Why wouldn't the pyvenv.cfg file NOT get created like it's supposed to.  After doing a search for it on C: drive it is not found.  If anyone has a copy of the file, would you please provide it and also tell me the folder to place it in? Thank you
msg374098 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2020-07-22 18:06
> "Python Launcher is sorry to say... No pyvenv.cfg file" 

As already mentioned, that it fails with this error means you're running a virtual-environment launcher instead of a base Python executable. That it displays a message box means you ran a GUI pythonw.exe virtual-environment launcher. pyvenv.cfg is a configuration file that the virtual-environment launcher looks for beside the executable, or one directory up. It tells the launcher where to find the base python[w].exe executable.

As already suggested, you should associate .py[w] scripts with the "Python" app that depicts a rocket/shuttle being launched on its icon. This will associate .py[w] scripts with the py[w].exe launcher, and it also associates them with a shell drop handler that allows files to be dragged and dropped on a script icon in Explorer.
msg374129 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2020-07-23 08:28
> it fails with this error means you're running a virtual-environment launcher instead of a base Python executable.

Exactly. It sounds like you probably searched for pythonw.exe and found the one in Lib/venv/scripts/nt instead of the actual one.

The default association should go to pyw.exe, which is likely in your C:\Windows directory.
msg374135 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2020-07-23 13:09
> The default association should go to pyw.exe, which is likely in 
> your C:\Windows directory.

However, don't browse for pyw.exe. That will create a new progid that doesn't support command-line arguments or a shell drop handler. You should select the Python app from the list that shows a rocket/shuttle being launched on its icon. If it isn't shown or doesn't work properly, try repairing your installation of Python.
History
Date User Action Args
2022-04-11 14:59:33adminsetgithub: 85537
2020-07-23 13:09:20eryksunsetmessages: + msg374135
2020-07-23 08:28:12steve.dowersetmessages: + msg374129
2020-07-22 18:06:10eryksunsetnosy: + eryksun
messages: + msg374098
2020-07-22 17:02:04Packhashsetfiles: + screenshot.png

messages: + msg374097
2020-07-22 15:38:45Packhashsetmessages: + msg374094
2020-07-22 11:37:22steve.dowersetmessages: + msg374092
2020-07-22 03:28:47Packhashcreate