SPIFFS Upload Failed(ESP8266 sketch Data) - arduino-esp8266

Traceback (most recent call last):
File "/home/apurv/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/serialposix.py", line 265, in open
self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/apurv/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/upload.py", line 65, in
esptool.main(cmdline)
File "/home/apurv/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 2889, in main
esp = chip_class(each_port, initial_baud, args.trace)
File "/home/apurv/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/esptool/esptool.py", line 237, in init
self._port = serial.serial_for_url(port)
File "/home/apurv/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/init.py", line 88, in serial_for_url
instance.open()
File "/home/apurv/.arduino15/packages/esp8266/hardware/esp8266/2.7.4/tools/pyserial/serial/serialposix.py", line 268, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
SPIFFS Upload failed!

I ran into the same issue just because I had the serial monitor opened

Related

Python: PermissionError: [Errno 13] with copy_tree function in windows

Im just copying all files and subfolders from an specific directory using the function distutils.dir_util.copy_tree in Windows:
from distutils.dir_util import copy_tree
from datetime import datetime
directories_to_backup = {
'folder_a' : 'e:\\folder_a',
}
now = datetime.now()
backup_name_folder = now.strftime("%Y%m%d-%H%M")
for name_folder, path_folder in directories_to_backup.items():
print(f'Backuping up the folder {name_folder}')
backup_full_path = f't:\\zzzBackup\\{backup_name_folder}\\{name_folder}\\'
copy_tree(path_folder, backup_full_path)
it works fine till it get to some specific file and rise the following error:
Traceback (most recent call last):
File "C:\Users\UserR\AppData\Local\Programs\Python\Python37\lib\distutils\file_util.py", line 48, in _copy_file_contents
buf = fsrc.read(buffer_size)
PermissionError: [Errno 13] Permission denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/UserR/PycharmProjects/my_scripts/main_backup.py", line 28, in <module>
copy_tree(path_folder, backup_full_path)
File "C:\Users\UserR\AppData\Local\Programs\Python\Python37\lib\distutils\dir_util.py", line 159, in copy_tree
verbose=verbose, dry_run=dry_run))
File "C:\Users\UserR\AppData\Local\Programs\Python\Python37\lib\distutils\dir_util.py", line 159, in copy_tree
verbose=verbose, dry_run=dry_run))
File "C:\Users\UserR\AppData\Local\Programs\Python\Python37\lib\distutils\dir_util.py", line 159, in copy_tree
verbose=verbose, dry_run=dry_run))
[Previous line repeated 1 more times]
File "C:\Users\UserR\AppData\Local\Programs\Python\Python37\lib\distutils\dir_util.py", line 163, in copy_tree
dry_run=dry_run)
File "C:\Users\UserR\AppData\Local\Programs\Python\Python37\lib\distutils\file_util.py", line 151, in copy_file
_copy_file_contents(src, dst)
File "C:\Users\UserR\AppData\Local\Programs\Python\Python37\lib\distutils\file_util.py", line 51, in _copy_file_contents
"could not read from '%s': %s" % (src, e.strerror))
distutils.errors.DistutilsFileError: could not read from 'e:\folder_a\0\binlog': Permission denied
Process finished with exit code 1
How can I update the permissions in windows so my script would be able to read and copy the files?

file not found error, though file is in proper place

C:\Users\ebena\PycharmProjects\untitled2\venv\Scripts\python.exe C:/Users/ebena/PycharmProjects/untitled2/trial.py
Traceback (most recent call last):
File "C:/Users/ebena/PycharmProjects/untitled2/trial.py", line 5, in <module>
image = Image.open("book background.jpeg")
File "C:\Users\ebena\PycharmProjects\untitled2\venv\lib\site-packages\PIL\Image.py", line 2878, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'book background.jpeg'
python cannot access these files and says they do not exist or file not found
Change the name of the file to book_background.jpeg

When trying to install GDAL with pip to a macOS I keep getting an error about a file not found, shouldn't the installer have all of the files?

When I try using pip install to get GDAL I run into an error about a file not found. I went to the location and there is definitely no folder there but shouldn't the installer install the folder it needs first?
Collecting GDAL
Using cached https://files.pythonhosted.org/packages/7c/b0/a2ecb10a68a319910c4681f452c83843b99c4ef6231d33a8e55b0104a50c/GDAL-2.4.0.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info/GDAL.egg-info
writing pip-egg-info/GDAL.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/GDAL.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/GDAL.egg-info/top_level.txt
writing manifest file 'pip-egg-info/GDAL.egg-info/SOURCES.txt'
Traceback (most recent call last):
File "/private/var/folders/js/c2_gdy711m7933z9bxcv2q5h0000gn/T/pip-install-jv2fugnm/GDAL/setup.py", line 151, in fetch_config
p = subprocess.Popen([command, args], stdout=subprocess.PIPE)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '../../apps/gdal-config': '../../apps/gdal-config'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/private/var/folders/js/c2_gdy711m7933z9bxcv2q5h0000gn/T/pip-install-jv2fugnm/GDAL/setup.py", line 237, in get_gdal_config
return fetch_config(option, gdal_config=self.gdal_config)
File "/private/var/folders/js/c2_gdy711m7933z9bxcv2q5h0000gn/T/pip-install-jv2fugnm/GDAL/setup.py", line 154, in fetch_config
raise gdal_config_error(e)
__main__.gdal_config_error: [Errno 2] No such file or directory: '../../apps/gdal-config': '../../apps/gdal-config'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/private/var/folders/js/c2_gdy711m7933z9bxcv2q5h0000gn/T/pip-install-jv2fugnm/GDAL/setup.py", line 151, in fetch_config
p = subprocess.Popen([command, args], stdout=subprocess.PIPE)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
restore_signals, start_new_session)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'gdal-config': 'gdal-config'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/js/c2_gdy711m7933z9bxcv2q5h0000gn/T/pip-install-jv2fugnm/GDAL/setup.py", line 430, in <module>
setup(**setup_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/setuptools/__init__.py", line 143, in setup
return distutils.core.setup(**attrs)
.................................
File "/private/var/folders/js/c2_gdy711m7933z9bxcv2q5h0000gn/T/pip-install-jv2fugnm/GDAL/setup.py", line 154, in fetch_config
raise gdal_config_error(e)
__main__.gdal_config_error: [Errno 2] No such file or directory: 'gdal-config': 'gdal-config'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/js/c2_gdy711m7933z9bxcv2q5h0000gn/T/pip-install-jv2fugnm/GDAL/

FileExistsError: [Errno 17] File exists: '/root/analytics/venv-nerapi/lib/python3.6/lib-dynload' while creating virtual environment

$virtualenv -p python3.6m ../venv-nerapi
Above command gives following error.
Running virtualenv with interpreter /usr/local/bin/python3.6m
Using base prefix '/usr/local'
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/virtualenv.py", line 352, in copyfile
os.symlink(srcpath, dest)
FileExistsError: [Errno 17] File exists: '/usr/local/lib/python3.6/lib-dynload' -> '/root/analytics/venv-nerapi/lib/python3.6/lib-dynload'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/virtualenv.py", line 2343, in <module>
main()
File "/usr/local/lib/python3.6/site-packages/virtualenv.py", line 712, in main
symlink=options.symlink)
File "/usr/local/lib/python3.6/site-packages/virtualenv.py", line 927, in create_environment
site_packages=site_packages, clear=clear, symlink=symlink))
File "/usr/local/lib/python3.6/site-packages/virtualenv.py", line 1132, in install_python
copyfile(join(stdlib_dir, fn), join(lib_dir, fn), symlink)
File "/usr/local/lib/python3.6/site-packages/virtualenv.py", line 355, in copyfile
copyfileordir(src, dest, symlink)
File "/usr/local/lib/python3.6/site-packages/virtualenv.py", line 330, in copyfileordir
shutil.copytree(src, dest, symlink)
File "/usr/local/lib/python3.6/shutil.py", line 315, in copytree
os.makedirs(dst)
File "/usr/local/lib/python3.6/os.py", line 220, in makedirs
mkdir(name, mode)
FileExistsError: [Errno 17] File exists: '/root/analytics/venv-nerapi/lib/python3.6/lib-dynload'
I followed following Github issue thread but din't find any luck.
Could any body tell whats went wrong ?
Thanks
Turns out that there was existing venv-nerapi . Deleting existing virtual env and re-creating it worked fine.

subprocess fails to call a function

I am trying to call a function using subprocess.Popen as:
proc = subprocess.Popen(["/usr/local/bin/qstat", "-u", "rudrab"],stdout=subprocess.PIPE)
numjobs = proc.stdout.read()
which is giving error:
Traceback (most recent call last):
File "genpos.py", line 159, in <module>
proc = subprocess.Popen(["/usr/local/bin/qstat", "-u", "rudrab"],stdout=subprocess.PIPE)
File "/opt/python-3.5/lib/python3.5/subprocess.py", line 950, in __init__
restore_signals, start_new_session)
File "/opt/python-3.5/lib/python3.5/subprocess.py", line 1544, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/bin/qstat'
but qstat is in my path:
which qstat
/usr/local/bin/qstat
what I am doing wrong here?

Resources