configureĬreate the virtual environment again at this time python3 -m venv myenv #Cygwin python 3 command install#The following error will be reported: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/virtualenv.py", line 22, in import zlib ModuleNotFoundError: No module named 'zlib'Īt this time, it is found that zlib is missing, so zlib must be installed sudo apt-get install zlib1g-devĪfter the installation is successful, you need to reinstall python3.6, that is, execute the installation statement in the python3.6 directory downloaded from the official website. Try to create a virtual environment with the virtualenv command again, and select python3.6 virtualenv -p python3.6 myenv01 The following error will be reported: Error: Command '' returned non-zero exit status 1. The following are the errors encountered and the solutions.Īfter installing pyhton3.6, create a virtual environment with python3.6 python3 -m venv myenv For instance I think javaw.exe is the gui version and java.exe is the console version (for java).Under ubuntu16.04, using the python3.5 that comes with the system to create a virtual environment is normal, but when I install python3.6, the installation of the virtual environment will report an error. I recall that for some interpreted languages there are different interpreter binaries depending on which entry point you wanted. int main() and the GUI way (I don't recall the name of the main function in this case). In addition, IIRC there are two ways of starting a program in windows. If so, the toolkit documentation would be where to go for that info. The toolkit you are using might have different behavior in either case. #Cygwin python 3 command windows#I'm not sure about the windows world/cygwin, but in the linux world it is possible for a program to determine whether or not stdin is a terminal. Presumably this is provided by some library/package you are using. I'm not familiar with the API winfo_screenwidth(). If you have multiple, then check which version is being executed with which python in each case. For example did you install through both cygwin and anaconda? Do you only have one python installed on your system? Or might you have multiple. The next thing is related, but what python interpreter is being executed in each case. Pro-tip: you can write the output of the env command to a file with env > c:/users//env1.txt (then use env2.txt from your shell script) and then compare them with the command line tool diff. #!/bin/shĬompare the two environments and see if there are any differences. Then add the same command to the start of your shell script. When running from the cygwin terminal execute the command env to see what the environment is (it's been a while since I've used windows, but I suspect env is part of cygwin or built into bash). My first guess would be a difference in the environment when you use the cygwin terminal and when you execute bash through the batch file. I don't know exactly what the issue is but here are a couple of things: Environment Why do these two methods give different results? How might I get a Python script to run with a resolution of (1920, 1200) in an automated way? Thank you. Then my GUI Python script runs but is distorted (i.e., it's too large for the screen), and the resolution comes back as (1280, 800). However, if I try to automate this process by double-clicking on the following Windows batch file: c:\cygwin\bin\bash c:/users//.sh (If w, h = root.winfo_screenwidth(), root.winfo_screenheight() appears in the Python script, for example, then the outputted values, corresponding to the screen resolution, are (1920, 1200).) When I start Windows, open a Cygwin terminal, enter export DISPLAY=:0.0 and then enter python c:/users//.py, my GUI Python script runs normally. #Cygwin python 3 command windows 8.1#I'm running Windows 8.1 / Cygwin 2.8.2 (and XWin Server at startup) / Python 2.7.13 (and am new to Cygwin and Python please let me know if I can provide more details). I'm getting a different screen resolution (in a Python script) depending on whether I type commands into Cygwin manually or run them using a shell script, and I can't understand why.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |