I am getting a "Tlc error: no display name...etc" when I try to open python scripts in idle using Cygwin. I type the following:
idle python_script.py
Do I need to install another Cygwin package to make this work? Windows 7- recently installed. Thanks!!:)
The error means that the program cannot find a display to show the window on. To solve that you need to install X Windows system and then set the display environment variable to:
export DISPLAY=:0.0
See this answer for more details: https://stackoverflow.com/a/9418800/342473
Related
So I am trying to install and import pynput in VSCode but its showing me an error every time I try to do it. I used VSCode's in-built terminal to install it using pip and typed the following :
pip install pynput but this error is shown : Fatal error in launcher: Unable to create process using '"c:\users\vicks\appdata\local\programs\python\python38-32\python.exe" "C:\Users\vicks\AppData\Local\Programs\Python\Python38-32\Scripts\pip.exe" install pynput': The system cannot find the file specified
After receiving the following error, I tried using CMD to install it but the same error is shown. I also tried using python pip install pynput and it shows Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. even though I have python 3.9.7 and I have selected it as my interpreter in VSCode and I have IDLE(Python 64 bit) installed. How may I resolve the following error? Any help regarding the same is appreciated
Thanks in advance :)
There's no such thing as an in-built terminal in VS code. When you open a terminal in VS Code, it opens the default, which on Windows is usually equivalent to opening up CMD.
If you selected Python 3.9.7 as your default interpreter in VS Code, it does not mean that it will visible to your CMD / terminal. It just means that the VS Code IDE will refer to that instance of Python when launching the program from VS Code itself using the green button (or F5), and when scanning your code to point out missing packages, etc.
CMD will only automatically detect your Python if it's in your PATH environment variable. You should add the Python 3.9.7 base and Scripts path to this.
Also, it would be best if you could first uninstall conflicting versions (like your 3.8.x) of Python and remove them from PATH, assuming that this won't cause any problems for you. Perhaps keep a record all the installed packages in this old version of Python for future reference using pip freeze or pip list.
Check if c:\users\vicks\appdata\local\programs\python\python38-32\python.exe exists by typing cd c:\users\vicks\appdata\local\programs\python\python38-32
I have deleted old python versions and installed new python (version 3.5.2) and after i restarted computer I have lost system tray and icons on the desktop. I found some solutions that are based on setting up CCSM over terminal but it's not that simple as it looks like. There is no terminal and no ccsm installed anymore so i have followed one tutorial where you need to click on desktop, create new folder and try to run terminal from /usr/bin/ directory. Because there was no terminal i found xterminal and started with entering commands like DISPLAY=:0 ccsm but i got error "bad interpreter".
Anyways, i found some way to delete and reinstall python and i can see its installed in Python-3.5.0 directory. So i was thinking i start the DISPLAY command thru script and run it with python3.5 someScript.py command. That part was success but then i got error " no ccsm " which is true. So...
1.) i try to install with sudo apt-get install compizconfig-settings-manager
but i got error https://ibb.co/Jdm6BFf
2.) after googling i found some solutions for this but then i land it in the same problem:
https://ibb.co/x8LHFjy
3.) btw. i try to install "minimal" version of python and it was installed but with some errors.
It looks like that path to python is not a problem, because I run the script directly so it must be missing packages, i have no clue how to update it or what to do next...
Purging python and trying to reinstall again ?
Thank you guys for your answers !
E.
I am trying to install Python 2.7 (64 bit) on Windows 10. In the middle of the installation, a window pops up saying:
Error writing to file C:\Python27\pythonw.exe. Verify that you have
access to that directory
How can I resolve this issue and install Python?
This error is normally encountered when the installer does not have admin rights for the drive/folder you are installing to. I also noticed that you are installing to drive C:
Here are a couple of things for you to try.
Open the installer program by right-clicking, and then selecting "Run as Administrator".
Depending on how you have your PC set up you may not have permission to install on drive C:
If this is a work computer, talk to your IT department. Otherwise, seriously consider using different drives to keep your OS and your applications separated.
I encountered a similar issue while installing Python 2.7.11 on Windows 7 (64bit). Here is how I solved the error.
Note down the path mentioned in the error.
Do not close the error message. i.e. Do not press "Retry" or "Cancel", let it be there.
Go to the directory mentioned in step-1.
Try to create a new folder or text file in this directory.
You will get an error message saying "The Disc Structure is Corrupted and Unreadable". This is the real issue which is causing the Python installation to fail.
Run Command Prompt as an administrator and enter the command: Chkdsk \f C:
Either it will start checking the disc or it will ask you to select if you want to check disc next time you boot-up your machine. Select Yes and restart your machine.
A disc check will be performed, which may take 5-10 minutes.
Now you can install Python without any issue.
I had the same problem , this is how I solved the error :
click on cancel
go to c:\
create a new folder and call it python or python3
run the python install as administrator and choose the new folder that you just created
as directory where it should be installed
et voila !
Your Windows 10 version may not be activated. So many administrator features are locked in inactivated Windows10 version.
So try to open CMD in administrator mode and run following command to ignore the activation message.
slmgr -rearm
Now you can install fresh version of python with pythonw.exe features.
Right Click The running Uninstaller. Then Right Click Python 3.9.1 64-bit as shown below in the picture. ( I have Python 3.9.1. You can do it in any Uninstaller) Now it will repair without any errors. ^_^
I have installed python 2.7.11 from this link and then restarted my system. However when I go to cmd and run python --version. It gives me an error that
python not recognized as an internal or external command.
So I try to manually add it to my Path variable I see my python being installed at C:\Python27 so I add someotherpath;C:\Python27 to path variable and reopened windows cmd. But it still gives me the same error.
Is there some other way to get over with this problem.
Thanks
Please run the following command in the command prompt.
echo %PATH%
It should have whatever path you have set manually. Otherwise Open a new Command prompt and try the same command.
Run python
If it is not working after that.
Please kindly check the Python.exe is available in C:\Python or Not ?
Changes in PATH variable do not affect already open programs. Close your command line (or powershell) window and reopen it in order to use new PATH variable.
I got same error there are two ways to solve
1)Try using py --version
2)If py is also not recognised than uninstall python and install it again but select the add to path optionas show in fig this time
Easiest way to fix this is to reinstall Python and check "Add to Path" button during the installation.
Python2.7 contains a scripts that adds location to path for windows.
So running
C:\Python27\Tools\Scripts\win_add2path.py
solved my issue
Using Python version 3.5 on Windows 10 64bit,
I'm unable to run the pip command. When I try running the application, the window will just open for a brief second and then closes.
I already tried adding the directory to the PATH environment variable and rebooting the system - didn't work.
when i try running the application the window will just open for brief second and then closes
Sounds like you are trying to open the pip.exe file and expect an interactive interface of some kind.
Unfortunately, that's not how you use pip. Open up a cmd, type your pip commands there. The command prompt will print and error, and not close, if there is a problem.