EDIT2: OK this is weird. (I can't answer my own question, so I just put it as another edit to the question. I think it has something to do with the fact that I tried to do this installation within a Dropbox-synced directory. I got this to work on my Desktop. Can anyone explain why this is the case?
Original question:
I'm trying to do Heroku's Python setup tutorial (http://devcenter.heroku.com/articles/python), on my Mac OS X (Lion), but I get caught up with the step of creating a virtualenv.
So what I did was this in the command line (not using sudo caused permissions error):
sudo pip install virtualenv
But then, when I do "virtualenv venv --distribute" (I also tried with sudo), I get the following error:
New python executable in venv/bin/python
Installing distribute..............................................................................................................................................................................................................................................................................................done.
Installing pip...
Error [Errno 2] No such file or directory while executing command /Users/AndyFang/Drop...env/bin/easy_install /Library/Python/2.7/...pport/pip-1.1.tar.gz
...Installing pip...done.
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 8, in <module>
load_entry_point('virtualenv==1.7.1.2', 'console_scripts', 'virtualenv')()
File "/Library/Python/2.7/site-packages/virtualenv.py", line 928, in main
never_download=options.never_download)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 1042, in create_environment
install_pip(py_executable, search_dirs=search_dirs, never_download=never_download)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 640, in install_pip
filter_stdout=_filter_setup)
File "/Library/Python/2.7/site-packages/virtualenv.py", line 966, in call_subprocess
cwd=cwd, env=env)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Not really sure what to do. It seemed like I didn't have easy_install on my Mac, but I do have it... I'm not sure what the deal is?
EDIT: I also just tried installing virtualenv with easy_install, but I get the exact same error.
If your problem is the same as mine, then it's because there's a space somewhere in the path to your Dropbox-synced folder.
Virtualenvs aren't portable, so you can't keep them synced across multiple machines if the paths don't match up.
In general, it's a bad idea :)
Related
While trying to run a python script on EC2 (running ubuntu), I'm getting this error:
Traceback (most recent call last):
File "128d.py", line 9, in <module>
"--pca_params", "./vggish_pca_params.npz"])
File "/usr/lib/python3.6/subprocess.py", line 267, in call
with Popen(*popenargs, **kwargs) as p:
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: 'python': 'python'
All the dependencies are installed. I've tested the script on my home machine (Windows 10), and it works just fine. I can see that something is wrong with python installed on the EC2 machine, probably. But I didn't manage to find an answer on the web.
I've fixed the problem.
Turns out, I had my python installed in a folder that was named python3. So, when the suprocess.py file tried to find python in path, it wasn't there.
I've renamed python3 in /usr/bin/ to python and the problem is fixed.
P.S. However, keep in mind, that it might raise some other issues. When I tried to aws s3 cp, it was looking for python3 instead. Maybe adding another copy of that folder as python3 would help.
Running on Ubuntu 16.04, Python 3.6.2
I have successfully used this package before. In fact, it works on a different pc but not the one I need it to work on.
https://pypi.python.org/pypi/pandas_access
import pandas_access as mdb
df = mdb.read_table("myDatabase", "myTable")
Traceback (most recent call last):
File "", line 1, in
File "/home/nfw/anaconda3/lib/python3.6/site-packages/pandas_access/init.py", line 118, in read_table schemas = to_pandas_schema(read_schema(rdb_file, schema_encoding),
File "/home/nfw/anaconda3/lib/python3.6/site-packages/pandas_access/init.py", line 59, in read_schema output = subprocess.check_output(['mdb-schema', rdb_file])
File "/home/nfw/anaconda3/lib/python3.6/subprocess.py", line 336, in check_output **kwargs).stdout
File "/home/nfw/anaconda3/lib/python3.6/subprocess.py", line 403, in run with Popen(*popenargs, **kwargs) as process:
File "/home/nfw/anaconda3/lib/python3.6/subprocess.py", line 707, in init restore_signals, start_new_session)
File "/home/nfw/anaconda3/lib/python3.6/subprocess.py", line 1333, in _execute_child raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'mdb-schema'
The code for pandas_access is available here
https://github.com/jbn/pandas_access/blob/master/pandas_access/init.py
It's supposed to only require MDB Tools which I have installed and it works. I can open the access database using MDB Tools on its own.
Solved!
I ran mdb-schema on the command line of the working pc and got:
Usage: mdb-schema [options] []
where options are:
-T Only create schema for named table
-N Prefix identifiers with namespace
I rant mdb-schema on the non-working pc and got:
The program 'mdb-schema' is currently not installed. You can install it by typing:
sudo apt install mdbtools
Not sure how I this wasn't installed as I was running gmdb2 on it for sure before this but oh well, need to move on.
My python version is 2.7. I tried to install pyjags using pip install pyjags but got such error:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags/setup.py", line 68, in <module>
add_jags(ext)
File "/private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags/setup.py", line 46, in add_jags
version = add_pkg_config(ext, 'jags')
File "/private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags/setup.py", line 34, in add_pkg_config
output = subprocess.check_output(args)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/dh/cyj9qhyj271945lvydyv5yr80000gn/T/pip-build-yuHm33/pyjags
I just deployed a python package and had same errors when I tried to install via pip. Turns out the main reasons was that the project artifacts (static files, etc) were not included in the MANIFEST file or it couldn't load a file path. I think you might want to consult the documentation here.
The line below was copied from the docs:
The setup.py script uses pkg-config to locate the JAGS library. If JAGS is installed in some non-standard location, then you may need to configure pkg-config to pick up correct metadata file. For example, if JAGS have been configured with --prefix=/opt/, then JAGS metadata file would be located in /opt/lib/pkgconfig/. This path can be included in pkg-config search path as follows:
export PKG_CONFIG_PATH=/opt/lib/pkgconfig/:$PKG_CONFIG_PATH
From your track trace, it seems like you failed to configure that.
pip is not a supported installation method. Read the installation instructions on the website enter link description here.
Let me start by saying I'm new at programming, mac osx, and bash.
I'm having a tough time getting virtualenvwrapper setup on my Mac osx 10.7.3.
Its most certainly a path settings issue but I'm just having trouble getting it working.
Setup of virtualenvwrapper in .bashrc
export WORKON_HOME=$HOME/.Apps
source /usr/local/bin/virtualenvwrapper.sh
Some terminal output:
which easy_install
/usr/bin/easy_install
python -V
Python 2.7.1
When I run "source .bashrc" in the terminal I get no output.
When I run mkvirtualenv in the terminal I get:
Error [Errno 2] No such file or directory while executing command install_name_tool -change /System/Library/Fram.../Versions/2.7/Python #executable_path/../.Python 1/bin/python
Could not call install_name_tool -- you must have Apple's development tools installed
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 9, in <module>
load_entry_point('virtualenv==1.7.1.2', 'console_scripts', 'virtualenv')()
File "/Library/Python/2.7/site-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 928, in main
never_download=options.never_download)
File "/Library/Python/2.7/site-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 1029, in create_environment
site_packages=site_packages, clear=clear))
File "/Library/Python/2.7/site-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 1347, in install_python
py_executable])
File "/Library/Python/2.7/site-packages/virtualenv-1.7.1.2-py2.7.egg/virtualenv.py", line 966, in call_subprocess
cwd=cwd, env=env)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 672, in __init__
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1202, in _execute_child
OSError: [Errno 2] No such file or directory
You probably just need to install XCode. It should be a free (if large) download/install from the App Store.
For future reference, I highly recommend using a package manager and pip (instead of easy_install) for python development on OS X. My preferred package manager is Homebrew, but MacPorts and Fink are also good. Among other things, pip lets you uninstall stuff, which easy_install cannot simply do.
I've been trying to get TurboGears installed on Windows by following this site.
I've installed virtualenv but when I execute the command "virtualenv --no-site-packages testproj", I get the following message:
New python executable in testproj\Scripts\python.exe
Traceback (most recent call last):
File "C:\Python26\Scripts\virtualenv-script.py", line 8, in
load_entry_point('virtualenv==1.4.5', 'console_scripts', 'virtualenv')()
File "C:\Python26\lib\site-packages\virtualenv-1.4.5-py2.6.egg\virtualenv.py", line 529, in main
use_distribute=options.use_distribute)
File "C:\Python26\lib\site-packages\virtualenv-1.4.5-py2.6.egg\virtualenv.py", line 612, in create_environment
site_packages=site_packages, clear=clear))
File "C:\Python26\lib\site-packages\virtualenv-1.4.5-py2.6.egg\virtualenv.py", line 837, in install_python
stdout=subprocess.PIPE)
File "C:\Python26\lib\subprocess.py", line 621, in __init__
errread, errwrite)
File "C:\Python26\lib\subprocess.py", line 830, in _execute_child
startupinfo)
WindowsError: [Error 14001] This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem
Can someone help me debug this ? If any one knows a better tutorial to install turbogears, please let me know.
I figured out the error. Apparently, virtualenv does not like it if folder names have spaces (eg Documents and Settings). It worked fine when my folder names had no spaces.