Error FileNotFoundError [winError 2] anaconda - python

i get the error bellow, running the python code,
im running the program through anaconda cause it works only with python 3.6 or something, but i get the following error.
Traceback (most recent call last):
File "inference.py", line 279, in
main()
File "inference.py", line 276, in main
subprocess.call(command, shell=True)
File "C:\ProgramData\Anaconda3\envs\wav2lip\lib\subprocess.py", line 287, in call
with Popen(*popenargs, kwargs) as p:
File "C:\ProgramData\Anaconda3\envs\wav2lip\lib\subprocess.py", line 729, in init
restore_signals, start_new_session)
File "C:\ProgramData\Anaconda3\envs\wav2lip\lib\subprocess.py", line 1017, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
thank you for any help for solving the issue.
Note : i set the path on the system for the ffmpeg as well which is needed for the program to run, i dont know if this is the issue.
command = 'ffmpeg -y -i {} -i {} -strict -2 -q:v 1 {}'.format(args.audio, 'temp/result.avi', args.outfile)

#Sollekram dakap
Just download and install ffmpeg from here https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full.7z
and add it to your system environment

Related

FileNotFoundError: [Errno 2] No such file or directory: '/opt/caffe/build/tools/caffe': '/opt/caffe/build/tools/caffe'

I installed caffe-cpu on my Ubuntu v18 VM via the apt install command. I am struggling to figure out where the install directory is located, correct me if I'm wrong but I believe there is not a install directory. My NN model I'm trying to execute requires the path of build tools from caffe. How can I obtain this? I have not seen any information about this anywhere.
INFO 2018-08-04 09:41:40: Setting up mAlexNet trained on PKLot_train, validated on PKLot_val, CNRPark-EXT_val, tested on PKLot_test_CNRPark-EXT_test ...
sh: 1: /opt/caffe/python/draw_net.py: not found
INFO 2018-08-04 09:41:40: Training on PKLot_train while validating on PKLot_val, CNRPark-EXT_val ...
Traceback (most recent call last):
File "main.py", line 99, in <module>
exp.run(plot=False) # run without live plot
File "/home/sarim/Desktop/deep-parking/pyffe/experiment.py", line 42, in decorator
return function(*args, **kwargs)
File "/home/sarim/Desktop/deep-parking/pyffe/experiment.py", line 399, in run
caffe = subprocess.Popen(cmd, stderr=subprocess.PIPE)
File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/opt/caffe/build/tools/caffe': '/opt/caffe/build/tools/caffe'
The Ubuntu packages for caffe install the caffe executable in /usr/bin. The particular file you want is in caffe-tools-cpu, not caffe-cpu as such.
From https://packages.ubuntu.com/bionic/amd64/caffe-tools-cpu/filelist:
/usr/bin/caffe
/usr/bin/classification
/usr/bin/compute_image_mean
/usr/bin/convert_cifar_data
/usr/bin/convert_imageset
/usr/bin/convert_mnist_data
/usr/bin/convert_mnist_siamese_data
/usr/bin/extract_features
/usr/bin/upgrade_net_proto_binary
/usr/bin/upgrade_net_proto_text
/usr/bin/upgrade_solver_proto_text
/usr/share/bash-completion/completions/caffe
/usr/share/doc/caffe-tools-cpu/changelog.Debian.gz
/usr/share/doc/caffe-tools-cpu/copyright
/usr/share/lintian/overrides/caffe-tools-cpu
/usr/share/man/man1/caffe.1.gz

Python subprocess using Idle

I am new to python scripting. I am trying to run subprocess methods on Python Idle and getting these errors:
import subprocess
subprocess.check_output("ls")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\ramakrishna\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Users\ramakrishna\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 403, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\ramakrishna\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 707, in __init__
restore_signals, start_new_session)
File "C:\Users\ramakrishna\AppData\Local\Programs\Python\Python36\lib\subprocess.py", line 990, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
Please help me out to resolve this error.
Thank you
seems like you are running windows. Windows has no "ls" command, so you get a FileNotFoundError exception. I am not familiar with windows and python, but try "dir" instead of "ls", that should work.

Cannot import jsonstreamer / cannot pip install yajl-py

I'm trying to use JSON streamer to parse a large 11gb JSON file. JSONstreamer appears to be the only package that streams the file without having to load the entire file into memory first.
When I try to import jsonstreamer in python I get this error.
OSError: Yajl cannot be found.
When I try to pip install yajl I get this error:
File "C:\Python34\lib\subprocess.py", line 1112, in _execute_child startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
However all there files are there
I downloaded the yajl.dll file from their webpage and added it into my C:\Windows\SysWOW64 dir.
Don't really have any ideas how to proceed because it seems like I am stuck.
I had the same problem, it's fixed installing git on the machine: there is a dependency for it in pip3 scripts.
The key was on the log, you can see how a git subprocess is executed:
Running setup.py (path:/tmp/pip-build-01hs0gev/yajl/setup.py) egg_info for package yajl
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-01hs0gev/yajl/setup.py", line 64, in <module>
subprocess.call(['git', 'submodule', 'update',])
File "/usr/lib/python3.4/subprocess.py", line 537, in call
with Popen(*popenargs, **kwargs) as p:
File "/usr/lib/python3.4/subprocess.py", line 859, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.4/subprocess.py", line 1457, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'git'

Chromium build gclient runhooks error number 13

I am getting the following error while running gclient runhooks for building chromium.
running '/usr/bin/python src/tools/clang/scripts/update.py --if-needed' in '/media/usrname/!!ChiLL out!!'
Traceback (most recent call last):
File "src/tools/clang/scripts/update.py", line 283, in
sys.exit(main())
File "src/tools/clang/scripts/update.py", line 269, in main
stderr=os.fdopen(os.dup(sys.stdin.fileno())))
File "/usr/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in init
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 13] Permission denied
Error: Command /usr/bin/python src/tools/clang/scripts/update.py --if-needed returned non-zero exit status 1 in /media/usrname/!!ChiLL out!!
In order to get permission of the directory "/usr/bin/python src/tools/clang/scripts" I tried chown and chmod but it returned the same error.
I think the python scripts in scripts directory are trying to modify some other files or directories .... try to trace what it is trying to do...... You have not specified the OS on which u are working ....... see this link https://github.com/aerospike/aerospike-client-python/issues/22
It says Linux Mint 17 is not supported officially.....
Actually the directory was not mounted with execution permission. So I remounted the directory with execution permission using
mount -o exec /dev/sda5 /media/usrname
and it worked fine.

Why does virtualenv throw an error when I try to define the python version as 2.7?

I tried to create a new virtualenv directory with sudo virtualenv curdir -p /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7 and it threw the following error:
Running virtualenv with interpreter /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==1.6.4', 'console_scripts', 'virtualenv')()
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/virtualenv.py", line 785, in main
popen = subprocess.Popen([interpreter, file] + sys.argv[1:], env=env)
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/subprocess.py", line 741, in __init__
restore_signals, start_new_session)
File "/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/subprocess.py", line 1356, in _execute_child
raise child_exception_type(errno_num, err_msg)
OSError: [Errno 13] Permission denied
I understand that I was not allowed to do that, but why? python 2.7 is located there and I want to use it. Is there any way to use it in my virtualenv?
I hope that this isn't too basic of a question. I am still pretty new to Unix command line.
You have to point to the python executable, which you are not doing here. Its located at /Library/Frameworks/Python.framework/Versions/2.7/bin/python. Run this
sudo virtualenv curdir -p /Library/Frameworks/Python.framework/Versions/2.7/bin/python

Categories

Resources