Cannot import jsonstreamer / cannot pip install yajl-py - python

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'

Related

Error FileNotFoundError [winError 2] anaconda

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

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

Getting error with subprocess while running aws s3 cp: [Errno 2] No such file or directory: 'aws'

I am able to execute this command successfully from command line and it copies the desired csv to the s3 bucket aws s3 cp /Users/kaswani/tips.csv s3://dplearn/
But, when I try to run the same from within python using subprocess it throws error:
subprocess.check_output(['aws','s3','cp','/Users/kaswani/tips.csv','s3://dplearn/'])
Error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/kaswani/anaconda/envs/aws/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/Users/kaswani/anaconda/envs/aws/lib/python3.5/subprocess.py", line 693, in run
with Popen(*popenargs, **kwargs) as process:
File "/Users/kaswani/anaconda/envs/aws/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/Users/kaswani/anaconda/envs/aws/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'aws'
I have not been able to debug it. Subprocess works just fine for basic commands like ls etc
Using, shell=True makes is work, i.e. subprocess.check_output(['aws','s3','cp','/Users/kaswani/tips.csv','s3://dplearn/'], shell=True)

Airflow HiveOperator not working

I am trying to use a hive operator in airflow. I have all the dependencies installed (pyhs2, pyhive, and ran pip install airflow[hive]).
However when I use the code below
t1 = HiveOperator(
task_id='simple_query',
hql='select * from cities',
dag=dag)
I get this error. I am not sure what it means
[2016-01-06 03:26:39,500] {models.py:1017} ERROR - [Errno 2] No such file or directory
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/airflow/models.py", line 977, in run
result = task_copy.execute(context=context)
File "/usr/local/lib/python2.7/dist-packages/airflow/operators/hive_operator.py", line 65, in execute
self.hook.run_cli(hql=self.hql, schema=self.schema)
File "/usr/local/lib/python2.7/dist-packages/airflow/hooks/hive_hooks.py", line 110, in run_cli
cwd=tmp_dir)
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 2] No such file or directory
[2016-01-06 03:26:39,512] {models.py:1053} ERROR - [Errno 2] No such file or directory
This error occurs when the hive command line interface (CLI) isn't available in your system path.

Getting an error when trying to install pyaardvark

I am using the canopy distribution of python (version 2.7.6) on win8-64, and when trying to use pip to install the module pyaardvark, I get the following error:
!pip install pyaardvark
Collecting pyaardvark
Using cached pyaardvark-0.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 20, in <module>
File "c:\...\appdata\local\temp\pip-build-5tvubw\pyaardvark\setup.py", line 13, in <module>
stderr=subprocess.STDOUT).rstrip()
File "c:\Program Files\Enthought\Canopy\App\appdata\canopy-1.4.0.1938.win-x86_64\lib\subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "c:\Program Files\Enthought\Canopy\App\appdata\canopy-1.4.0.1938.win-x86_64\lib\subprocess.py", line 709, in __init__
errread, errwrite)
File "c:\Program Files\Enthought\Canopy\App\appdata\canopy-1.4.0.1938.win-x86_64\lib\subprocess.py", line 957, in _execute_child
startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

Categories

Resources