No such file or directory error?
Are you staring at an error that says:
Or maybe:
Glib2 2.32.0 not building → glib2: libelf.h: No such file or directory This is not a clean build log (it contains lines saying 'Skipping completed'). Could you 'sudo port clean glib2'.
Are you saying something like: 'Curses! It works on my machine?'?
Use absolute, not relative paths
One common reason for these kinds of errors is that your working directory settings might be different on PythonAnywhere from your own machine.
The fix is to use the full, absolute path, instead of a 'relative' path. So, eg:
And not just myfile.txt.
Tip: __file__
for cross-platform scripts
C++ No Such File Or Directory
'That's annoying!', I hear you exclaim, 'my pythonanywhere username isn't the same as my local username. and I'm on Windows maybe, so paths arent' the same! Relative paths are so convenient! I don't want to run different code on my machine and on PA'. A very reasonable grumble. But fear not:
code like this, based on deriving the current path from Python's magic__file__
variable, will work both locally and on the server, both onWindows and on Linux...
Another possibility: case-sensitivity
One other thing that might be going on is that you're using the wRoNG cAsINg
.Casing doesn't matter on Windows but it does on Linux (and therefore, itmatters on PythonAnywhere). So, be consistent with Uppercase and lowercase!
2020腾讯云10周年活动,优惠非常大!(领取2860元代金券),
地址:https://cloud.tencent.com/act/cps/redirect?redirect=1040
2020阿里云最低价产品入口,含代金券(新老用户有优惠),
入口地址:https://www.aliyun.com/minisite/goods
I have just done a fresh install of Python 2.7 and Django 1.6.5.
Entering into python in the terminal and using import Django
and django.VERSION
yields:
(1, 6, 5, 'final', 0)
But when I attempt to run python django-admin.py startproject myproject
, I get the following:
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'django-admin.py': [Errno 2] No such file or directory
There doesn't seem to be a ton of info available on how to rectify this in a Mac, and the Django docs don't offer much assistance other that 'maybe try a symlink'.
Can someone help me solve this error?
Recommend:Mac osx LION :python cxfreeze installation error: stdarg.h: No such file or directory

XCODE 4.5.1 command to build cxfreeze : env ARCHFLAGS='-arch i386' python3 setup.py build Following error occurred, Hope someone have experienced or knows how to fix this. adding base module named token adding base module named tokenize add
EDIT: Here is the result of running echo $PATH
/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
Mac Download No Such File Or Directory
|
this question asked May 16 '14 at 0:47 bhamhawker 45 1 8 You should follow the django instructions exactly ;) – Vasili Syrakis May 16 '14 at 0:53 I was following the Tango with Django instructions. – bhamhawker May 16 '14 at 0:54 |
1 Answers
1
---Accepted---Accepted---Accepted---Try running without python
Explanation: It's because django-admin.py
is added in one of the bin folders. Also, python
expects a file path.
|
this answer answered May 16 '14 at 0:52 Rod Xavier 2,818 1 14 33 That worked, but can you explain why? Did I miss something? – bhamhawker May 16 '14 at 0:53 Added the explanation in the answer. – Rod Xavier May 16 '14 at 0:56 Much obliged. Will accept when the time limit hits. – bhamhawker May 16 '14 at 0:57 Urgh, I've wasted 20 minutes trying to fix that with a symlink, and all I had to do was drop the python. Thanks! (Symlink didn't work as it was trying to pull that python ^^ path first, so failed before it got to it, I think?) – Withnail Jun 13 '14 at 15:13 |
Recommend:osx - Could not open requirements file: [Errno 2] No such file or directory: './requirements.txt' Python on Mac
pip install bitfinexbitfinex-poll-orderbookpip install -r ./requirements.txt The first two work perfectly fine and I am able see the orderbook for Bitfinex, a bitcoin trading exchange. When I put the third line I get the following err
Recommend:osx - Could not open requirements file: [Errno 2] No such file or directory: './requirements.txt' Python on Mac
pip install bitfinexbitfinex-poll-orderbookpip install -r ./requirements.txt The first two work perfectly fine and I am able see the orderbook for Bitfinex, a bitcoin trading exchange. When I put the third line I get the following err