Python3.9.0 Idle Wont Open How Do I Fix This? - python

I am not sure why my python 3.9 idle isnt opening VIDEO I have tried multiple times but it still isnt opening for me
I tried repairing it in control panel but it still isnt working
I also tried to reinstall it but I am still having the same problem it just wont open no matter how much I click
my idle path on my folder enter image description here
C:\Users\Habib\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.9
on my IDle properties it says V
TARGET: C:\Users\Habib\AppData\Local\Programs\Python\Python39\pythonw.exe "C:\Users\Habib\AppData\Local\Programs\Python\Python39\Lib\idlelib\idle.pyw"
START: C:\Users\Habib\AppData\Local\Programs\Python\Python39\
OUTPUT I GET WHEN I PUT py -m idlelib
Traceback (most recent call last):
File "C:\Users\Habib\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Habib\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Habib\AppData\Local\Programs\Python\Python39\lib\idlelib\__main__.py", line 6, in <module>
import idlelib.pyshell
File "C:\Users\Habib\AppData\Local\Programs\Python\Python39\lib\idlelib\pyshell.py", line 49, in <module>
from idlelib.colorizer import ColorDelegator
File "C:\Users\Habib\AppData\Local\Programs\Python\Python39\lib\idlelib\colorizer.py", line 6, in <module>
from idlelib.config import idleConf
File "C:\Users\Habib\AppData\Local\Programs\Python\Python39\lib\idlelib\config.py", line 766, in <module>
idleConf = IdleConf()
File "C:\Users\Habib\AppData\Local\Programs\Python\Python39\lib\idlelib\config.py", line 166, in __init__
self.LoadCfgFiles()
File "C:\Users\Habib\AppData\Local\Programs\Python\Python39\lib\idlelib\config.py", line 758, in LoadCfgFiles
self.userCfg[key].Load() #same keys
File "C:\Users\Habib\AppData\Local\Programs\Python\Python39\lib\idlelib\config.py", line 77, in Load
self.read(self.file)
File "C:\Users\Habib\AppData\Local\Programs\Python\Python39\lib\configparser.py", line 697, in read
self._read(fp, filename)
File "C:\Users\Habib\AppData\Local\Programs\Python\Python39\lib\configparser.py", line 1082, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: 'C:\\Users\\Habib\\.idlerc\\config-main.cfg', line: 1
'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'

Python 3.9 is very new and it may not be working with your system try switching back to python 3.8.6 and it looks like you havent added python to path

I had the same problem and I was trying to open (pythonw.exe)
it turns out that I had to open Python\Lib\idlelib\idle.py type(python file(no console))

Related

MassWappalyzer: can't run the script

Has anyone tried tried to run MassWappalyzer?
From GitHub: **https://github.com/tristanlatr/MassWappalyzer
**
Hi,
I am trying to run MassWappalyzer on my terminal. i have already installed everything and got my MassWappalyzer folder installed, with the script, samples, etc.
However, when I try running the command python3 -m masswappalyzer -i websites.txt -o websites.xlsx
It states this:
Mass Wappalyzer
Using python-Wappalyzer
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/Users/andreualegre/MassWappalyzer/masswappalyzer.py", line 408, in
main()
File "/Users/andreualegre/MassWappalyzer/masswappalyzer.py", line 401, in main
mass_w = MassWappalyzer(urls, **args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/andreualegre/MassWappalyzer/masswappalyzer.py", line 281, in init
self.analyzer = WappalyzerWrapper(
^^^^^^^^^^^^^^^^^^
File "/Users/andreualegre/MassWappalyzer/masswappalyzer.py", line 247, in init
self._analyze = PythonWappalyzer().analyze
^^^^^^^^^^^^^^^^^^
File "/Users/andreualegre/MassWappalyzer/masswappalyzer.py", line 185, in init
self._wappalyzer = self.Wappalyzer.Wappalyzer.latest(update=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Wappalyzer.latest() got an unexpected keyword argument 'update'
Can anyone help me out?
Thank you!
I have already installed everything and tried different ways to run this code. However, couldn't be able to get the solution. I have also asked the dev fro GitHub's, but he haven't answered yet, that's why I am asking here.

How to solve toml.decoder.TomlDecodeError: Key group not on a line by itself. (line 1 column 1 ...) error when calling streamlit package?

I just installed the streamlit package. When I try to run 'streamlit hello' I get the following error:
(base) C:\>streamlit hello Traceback (most recent call last):
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\runpy.py",
line 193, in _run_module_as_main "__main__", mod_spec)
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\runpy.py",
line 85, in _run_code exec(code, run_globals)
File "C:\Users\s158539\AppData\Local\Continuum\anaconda3\Scripts\streamlit.exe\__main__.py",
line 5, in <module>
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\__init__.py",
line 121, in <module> from streamlit.DeltaGenerator import DeltaGenerator as _DeltaGenerator
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\DeltaGenerator.py",
line 33, in <module> from streamlit import caching
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\caching.py",
line 38, in <module> from streamlit.hashing import CodeHasher
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\hashing.py",
line 36, in <module> from streamlit.folder_black_list import FolderBlackList
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\folder_black_list.py",
line 39, in <module> if config.get_option("global.developmentMode"):
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\config.py",
line 94, in get_option parse_config_file()
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\config.py",
line 877, in parse_config_file _update_config_with_toml(file_contents, filename)
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\streamlit\config.py",
line 799, in _update_config_with_toml parsed_config_file = toml.loads(raw_toml)
File "c:\users\s158539\appdata\local\continuum\anaconda3\lib\site-packages\toml\decoder.py",
line 379, in loads original, pos) toml.decoder.TomlDecodeError: Key group not on a line by itself. (line 1 column 1 char
Does anyone know how to solve this error?
Thank you in advance!
Just delete the config.toml file which can be found in the directory where you have installed streamlit.
I also got the same error while I tried to run the 'streamlit' command.
So, what I did is track in the code entirely to see from where I can find this 'config.toml' and simply deleted the file.
The path for 'config.toml' file in Windows is: C:users/{username}/.streamlit/config.toml
Delete this file and it will solve the error.
If you are not able to locate your .streamlit directory
Run streamlit cache clear
Output :
Nothing to clear at {Username}\{path}\.streamlit\cache.
You will get output similar to this which will tell you where is your .streamlit directory exactly.
Take this path before the cache part
cd {Username}\{path}\.streamlit
You'll be able to see config.toml here just delete that file.
The Streamlit forum has this discussion topic: https://discuss.streamlit.io/t/toml-docoder-error/1400/10 that discusses this. Hope this helps!
delete the content of config.toml file which is
in C:\Users\username.streamlit
Do you have a setup.sh file? What's the content inside it?
maybe you will just have to put the content of setup.sh everything in 1 line like this
[server]\nheadless = true\nenableCORS=false\nport = \n
my problem was similar, not exactly like this. so I hope it works!

Python Behave BDD Tutorial Error on Windows

So, I`m comparing some python test frameworks and came across behave. Thought it was interesting and worth a test drive.
Followed the steps on the tutorial, available at:
https://behave.readthedocs.io/en/stable/tutorial.html
When I ran the behave command on Powershell (Win10 and Python 2.7.10), I got the following error:
Exception TypeError: compile() expected string without null bytes
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\lib\site-packages\behave\__main__.py", line 187, in <module>
sys.exit(main())
File "C:\Python27\lib\site-packages\behave\__main__.py", line 183, in main
return run_behave(config)
File "C:\Python27\lib\site-packages\behave\__main__.py", line 127, in run_behave
failed = runner.run()
File "C:\Python27\lib\site-packages\behave\runner.py", line 804, in run
return self.run_with_paths()
File "C:\Python27\lib\site-packages\behave\runner.py", line 809, in run_with_paths
self.load_step_definitions()
File "C:\Python27\lib\site-packages\behave\runner.py", line 796, in load_step_definitions
load_step_modules(step_paths)
File "C:\Python27\lib\site-packages\behave\runner_util.py", line 412, in load_step_modules
exec_file(os.path.join(path, name), step_module_globals)
File "C:\Python27\lib\site-packages\behave\runner_util.py", line 385, in exec_file
code = compile(f.read(), filename2, "exec", dont_inherit=True)
TypeError: compile() expected string without null bytes
Has anyone encountered this error while trying to run behave? (Found some threads online related mainly to flask issues but I couldn't solve the problem)
Answering my own question here.
It was an encoding problem.
Sublime was saving my files with an encoding different from UTF-8.
File -> Save with Encoding -> UTF-8 did the trick.

Python code runs in interactive prompt but not as script

I am trying to interface with an Ocean optics spectrometer using seabreeze (seabreeze) and pyseabreeze (pyseabreeze).
If I enter python from the command prompt (cmd) in windows and enter the following code line by line, it works. However, if I put it in a script (spec_test.py) and try running it from cmd.exe by using 'python spec_test.py', it will not work.
I have searched around a lot for similar problems but none seem to cover the issue I'm having. I am running Windows 7 64 bit, python 3.5.2 installed using anaconda. I also had to install pyusb and libusb to use pyseabreeze.
The code:
import seabreeze
seabreeze.use('pyseabreeze')
import seabreeze.spectrometers as sb
devs = sb.list_devices()
print(devs)
spec = sb.Spectrometer(devs[0])
print(spec.model)
and the error message I get:
[<SeaBreezeDevice USB2000PLUS:FLMS02379>]
Traceback (most recent call last):
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\pyseabreeze\interfaces\common.py", line 14, in decorated_func
return func(*args, **kwargs)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\pyseabreeze\interfaces\spectrometer.py", line 46, in open
self.open_device(device.handle)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\pyseabreeze\interfaces\communication.py", line 37, in open_device
device.set_configuration()
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\usb\core.py", line 869, in set_configuration
self._ctx.managed_set_configuration(self, configuration)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\usb\core.py", line 102, in wrapper
return f(self, *args, **kwargs)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\usb\core.py", line 148, in managed_set_configuration
self.backend.set_configuration(self.handle, cfg.bConfigurationValue)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\usb\backend\libusb0.py", line 493, in set_configuration
_check(_lib.usb_set_configuration(dev_handle, config_value))
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\usb\backend\libusb0.py", line 431, in _check
raise USBError(errmsg, ret)
usb.core.USBError: [Errno None] b'libusb0-dll:err [set_configuration] could not set config 1: win error: The parameter is incorrect.\r\n'
Traceback (most recent call last):
File "<ipython-input-9-ead886eb3666>", line 1, in <module>
runfile('C:/Users/Raman Lab/Python code/Spectrometers/spec_testing.py', wdir='C:/Users/Raman Lab/Python code/Spectrometers')
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 866, in runfile
execfile(filename, namespace)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "C:/Users/Raman Lab/Python code/Spectrometers/spec_testing.py", line 7, in <module>
spec = sb.Spectrometer(devs[0])
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\spectrometers.py", line 62, in __init__
self._open_device(device)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\spectrometers.py", line 90, in _open_device
lib.device_open(self._dev)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\pyseabreeze\wrapper.py", line 81, in device_open
return device.interface.open(device)
File "C:\Users\Raman Lab\AppData\Local\Continuum\Anaconda3\lib\site-packages\seabreeze\pyseabreeze\interfaces\common.py", line 23, in decorated_func
raise SeaBreezeError(msg)
SeaBreezeError: An error occured during opening.
Thanks for any help!
Edit:
For some reason I figured this out, thought it might help describe the issue. If I enter interactive python from cmd.exe and paste the code instead of typing it in manually, I get the same error. This makes me think (most likely I'm wrong) that it is somehow tied up with speed of imports. I tried adding a sleep for a few seconds in between lines 3 and 5, to simulate what happens when I am typing in the prompt, but that didn't help. I hope this was descriptive enough.
Your initial guess was not far off. I had exactly the same problem, however, on Windows 7 32bit with Python 2.7. The example code gchaks linked to was running fine.
When I tried executing the script several times in quick succession, the error message changed and pointed at a empty devices list. I added a delay of 2 seconds after
devs = sb.list_devices()
and that solved the problem. Your code was running just fine on a Linux machine btw.
Another hint: If your code should run once, but then you run into another error message, make sure you close the device connection or dis- and reconnect the spectrometer.

Pychecker index error on first run

I've just installed pychecker on windows 7 Pro using "python setup.py install". When I run it on my script using the command:
c:\Python26\Scripts\pychecker -#100 finaltest17.py
I get the following error/traceback:
C:\Users\....\ToBeReleased>C:\Python26\python.exe C:\Python26\Lib\site-packages\pychecker\checker.py -#100 finaltest17.py
Processing module finaltest17 (finaltest17.py)...
Caught exception importing module finaltest17:
File "C:\Python26\Lib\site-packages\pychecker\pcmodules.py", line 533, in setupMainCode()
self.moduleName, self.moduleDir)
File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 184, in findModule()
handle, filename, smt = _q_find_module(p, path)
File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 162, in _q_find_module()
if not cfg().quixote:
File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 39, in cfg()
return _cfg[-1]
IndexError: list index out of range
Traceback (most recent call last):
File "C:\Python26\Lib\site-packages\pychecker\checker.py", line 364, in <module>
sys.exit(main(sys.argv))
File "C:\Python26\Lib\site-packages\pychecker\checker.py", line 337, in main
importWarnings = processFiles(files, _cfg, _print_processing)
File "C:\Python26\Lib\site-packages\pychecker\checker.py", line 270, in processFiles
loaded = pcmodule.load()
File "C:\Python26\Lib\site-packages\pychecker\pcmodules.py", line 477, in load
return utils.cfg().ignoreImportErrors
File "C:\Python26\Lib\site-packages\pychecker\pychecker\utils.py", line 39, in cfg
return _cfg[-1]
IndexError: list index out of range
If anyone could point me in the right direction that would be great.
Thanks
Stewart
Problem resolved.
I found the following support request on SourceForge which refers to a need to use short format (8.3) path and filenames in pychecker.bat and not long format as is allowed in newer versions of Windows.
https://sourceforge.net/p/pychecker/support-requests/7/#96cb

Categories

Resources