When I am trying to
import requests i get the following error
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\…\AppData\Local\Temp\tmp2o4693yn'
How may I solve this issue?
Thanks in advance
I’m using python 3.10 on windows 11
I could solve it by removing two *.pth files that were created when I had installed python-certifi-win32. deleting these two files prevents python-certifi-win32 from loading when python is run.
Location of the files
C:\Users<username>\AppData\Local\Programs\Python\Python310\Lib\site-packages
Files:
python-certifi-win32-init.pth
distutils-precedence.pth
Related
I'm building a simple """virus""" for testing my basic abilities in python (obviously I'm not share this file with others, this have only coding scope and I'm testing on virtual machine). I'm trying to destruct my virtual machine deleting System32 files.
I've searched a lot online: i've tested os.chmode (also with stat library) and other methods, but i can't find a valid solution, and i wish I can find it here. This is my code:
import os
import webbrowser
from time import sleep
home="C:/Windows/System32"
for dirpath,dirnames,file in os.walk(home):
webbrowser.open("https://cat-bounce.com/")
for dirpath,dirnames,file in os.walk(home):
for files in file:
webbrowser.open("https://cat-bounce.com/")
dirpath1=os.path.normpath(dirpath)
childpath=os.path.join(dirpath1,files)
try:
os.remove(childpath)
except PermissionError:
print("denied")
sleep(1.5)
print("\nare you alive?")
for all the solution the output was "denied" (from the print). Without try and except the error was
PermissionError: [WinError 5] Access denied: 'C:/Windows/System32'
P.S: sorry for grammatical errors, I'm not english😢
The easiest way is to run the code as an administrator.
I'm running into a problem using a boost-compiled c++ code for python2. I've gotten this to install correctly using the boost package for anaconda2-2019 on WSL, but importing the python package yields the error:
ImportError: libboost_python27.so.1.67.0: cannot open shared object file: No such file or directory
I found where the libboost_python27.so.1.67.0 lives in ~/anaconda2/lib/ so I'm not sure why I'm getting this error returned.
This is an old post but you could try the following solutions taken from similar problem at Error loading shared libraries of boost
link the c++ code module with the following flag
-Wl,-rpath,/path/to/boost/libraries -lboost_python
export the lib folder where the missing library is located
export LD_LIBRARY_PATH=/path/to/boost/libs:$LD_LIBRARY_PATH
I am trying to run an AWS Lambda function and I need pyodbc as a library. When importing pyodbc, I am getting the error:
Unable to import module 'lambda_function': /var/task/lib/libodbc.so.2: file too short.
I cannot find much on this error. Has anyone else experienced this / have advice on how to get past it?
So far, I have:
Spun up an EC2 instance and created a deployment package using a combination of these instructions here: https://gist.github.com/diriver63/b72a954fa0da4851d89e5086aa13c6e8 and here: https://www.youtube.com/watch?v=xWbU_OnkFOo. If I do not spin up an EC2 instance and package what I need with Linux, I get the error - "[unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)\").
I have ensured all my files are zipped individually rather than zipping a whole folder (if a entire folder is zipped I get a "cannot find lamdba_function" error)
Flattened out my file structure so all files are in the home drive, except those that were in lib and lib64 folders. If they are in separate folders, I get a different error - "Unable to import module 'lambda_function': No module named 'pyodbc'" OR "[01000] [unixODBC][Driver Manager]Can't open lib '\libodbc.so'"See current file structure
I ended up using these instructions: https://exagriddba.wordpress.com/category/python/ which got me past that point, however came into the problem of having too bigger file with 5 libraries and hitting the limit of 262mb. Will be using Docker instead, however I think those instructions would have seen us successful had it not been for the limits. Had many errors over the past 2 weeks so happy to try answer any questions!
I'm trying to install h5py in Maya. It seems like its installed properly in the correct folder, i.e. : C:\Program Files\Autodesk\Maya2018\Python\Lib\site-packages\h5py. But when I try to import h5py in Maya's Python tab, I'm getting the following error
ImportError: file C:\Program Files\Autodesk\Maya2018\Python\lib\site-packages\h5py\__init__.py line 26:
DLL load failed: The specified module could not be found.
Got this thing working , if anyone is facing this issue please follow the following article http://3deeplearner.com/neural-network-inside-maya/
The author of this tutorial helped a lot with the required solution for this issue
Thank you Gus from 3deeplearner.com
Context
Steps taken:
Environment Setup
I've installed protobufs via Home Brew
I've also followed the steps in the proto-bufs python folder's readme on installing python protobufs - namely running the python setup.py install command
I've using the protobuf-2.4.1 files
Coding
I have a python file (generated from a .proto file I compiled) that contains the statement, among other import statements, but I believe this one is the one causing issues:
from google.protobuf import descriptor_pb2
The above python file, I'm importing in another python file, it's
this python file that I want to write up logic for parsing the
protobufs data files I receive
Error received
I get this error when running that file:
Steps taken to fix
Searched google for that error - didn't find much
Looked at this question/answer Why do I see "cannot import name descriptor_pb2" error when using Google Protocol Buffers?
I don't really understand the above questions selected answer,I tried to run the command in the above answer protoc descriptor.proto --python_out=gen/ by coping and pasting it in the terminal in different places but couldn't get it to work
Question
How do I fix this error?
What is the underlying cause?
How do I check if the rest of my protobuf python compiler/classes are set up correctly?
I've discovered the issue. I had not run the python install instructions the first time I tried to compile this file. I recompiled the file and this issue was fixed.