gdal_calc.py Error: could not open file "a.geo" - anaconda

I've had a problem with gdal_calc for a few days that I didn't have before.
Basically, I should recalculate a GEO file and I've always used (via Anaconda Prompt):
python %CONDA_PREFIX%\Scripts\gdal_calc.py -A myfile.geo --outfile mynewfile.geo --calc="-(A*5/7)" --format=ENVI --NoDataValue=-9999 --overwrite
I've never had any problems, but since a few days, trying to convert a GEO file I get:
could not open file "file.geo"
I tried to convert the initially converted files back without problems and:
pressing Enter, I get nothing
I get the same error
I would like to understand where the problem could be.
I state that I have not made any changes to the path of the GDAL and Anaconda files

Related

Possibly corrupted ~.bash_profile [duplicate]

This question already has an answer here:
How to restore .bash_profile on a mac? None of my unix terminal are working [closed]
(1 answer)
Closed 3 years ago.
I will try to outline this as best I can because I know other people have had a version of this problem.
I received a routine update to Conda last week, which asked me to change the path for my environments. New to development and not knowing better, I was able to eventually access my ~.bash_profile and find that multiple installs of Anaconda had written multiple sets of system instructions. Again, not knowing any better, I wiped my profile and replaced it with Anaconda’s preferred path route.
Amazingly, Conda is about the one thing that is now working. I can activate my environments and run most of my Python commands, but none of my normal Terminal commands are working. I have tried solutions posted here including vi ~/.bash_profile, nano and echoing the path, but even when I access my profile, I do not know how to restore a functional bash. I somehow deleted my system’s ability to recognize Terminal commands including mkdir, -g, which, and so on.
A few Terminal promps that pop up on initialization:
-bash: open: command not found
-bash: /anaconda3/etc/profile.d/conda.sh: Permission denied
Any help here would be appreciated. I thought to restore from a backup, but Time Machine will not let me overwrite system configurations and I cannot drag & drop my old bash (the function to reveal hidden dot files is also disabled after deleting my bash) A link or gist to a good boilerplate bash profile for me to use would be nice, if anyone knows of one.
If /etc/skel exists on your machine, you can copy those files to your home directory to reset the profile to the default.

updating trouble in OSX

when I update my gcc in my macbook
it occurs:
org.macports.extract for port llvm-3.5 returned: Failed to locate 'xz' in path: '/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin' or at its MacPorts configuration time location, did you move it?
but actually I don't move anything because I am a newbie,when it downloads from macport ,for too slow network speed I press some return button and it seems to have this situation that download for llvm-3.5 is failed,but it seems that I can't redownload it.
what can I do to solve this and get my gcc updating?Thanks for telling me how to do it.
Either the file "xz" exists on your Mac or it doesn't.
To see if it exists, type this into the command line:
( find / -name xz -print > /dev/tty ) > & /dev/null
And what that does is that it scans your entire hard disk for a file named exactly "xz", piping any errors (i.e. files that can be read because of permission issues) away and leaving you with the path to "xz".
If "xz" exists, you can add the path to your .tcshrc file, or if it doesn't exist, you need to get it.

TCL file not found by NS2 in MAC OS X Mavericks

I have just installed NS2 on Mac OS X Mavericks (10.9)
I have set all the paths correctly.
I can successfully type 'ns' on the terminal, and 'nam' as well, and both execute without any problem.
The problem is that when I input a file to the ns command, it says:
couldn't read file "example.tcl": no such file or directory
I use this command in the terminal:
ns example.tcl
I also tried it running it in sudo mode:
sudo -s
ns example.tcl
I placed the file in the bin folder, where there's ns's shortcut, I also placed it where actually the ns is. I also tried giving it a full path to the tcl file, but no use in both the cases.
I also tried to run it after executing only ns first, and then within ns ran it (No idea if it works like this, I am just trying everything I have got!)
ns
%ns example.tcl (Hash sign shows the NS is running and I am typing the command there)
This time the error is:
warning: using backward compatibility mode
error when calling class OldSim: hello-ddos.tcl
The version of NS is 2.35.
NOTE: I changed the file extension from .tcl to .txt, and it works fine now. Any idea of the problem?
Please help!
The error message:
couldn't read file "example.tcl": no such file or directory
is pretty clear. It simply couldn't find the file; the OS returned an ENOENT error from the underlying system call to open the file. The usual reason for this is that the file isn't in the directory that you're running the program from, and the usual recommendation for dealing with this is to use the full name of the file instead of just the local path-less version. (It's technically possible for there to be other issues, but they usually produce different errors.)
What can cause this? Well, one of the most common things is if you (or some library code, such as what is inside NS2) does a cd to change the current directory. Using a full, absolute filename makes (or at least should make) your code much more resistant to that sort of thing.
Warning: note that the second part of your question relating to changing the filename is strange to me.
Check the directory of your file. It should be in the bin folder inside your ns folder.
Also you may try typing
sudo ./ns filename.tcl
to give you root access if by any chance you are detached from that.

Bash: cannot execute binary file (followed directions from online)

I am having difficulty installing something, and wanted to write a detailed list of what I did (including all paths, because I am new to Linux, and have problems reading things unless the full path is listed)
1) I am trying to run a program called "pslToBed". I downloaded it from here (http://hgdownload.cse.ucsc.edu/admin/exe/linux.x86_64/).
2) It downloaded a single file called "pslToBed". It looks like a binary file (all jibberish at least), and I saved to the directory /Users/MacOwner/Desktop/rnaseq/pslToBed
3) I did echo $PATH, and got the following
/usr/local/bin:/Users/MacOwner/anaconda/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/texbin:/usr/X11/bin:/opt/local/bin:~/bin:/Users/MacOwner/Desktop/bedtools2-2.19.1
4) I selected one path from step (3), namely /usr/local/bin
5) I did: cp /Users/MacOwner/Desktop/rnaseq/pslToBed /usr/local/bin/
6) I added the same line to the bottom of both ~/.bashrc and ~./bash_profile:
export PATH=$PATH:/usr/local/bin/pslToBed
Then, I returned to /Users/MacOwner/Desktop/rnaseq/ and tried to run pslToBed but got an error -bash: /usr/local/bin/pslToBed: cannot execute binary file
I know this may be straightforward to experienced users, but I am stuck, even after searching the internet for several hours now. Do my paths and ideas look correct? And if not, what should I do to get this program running?
First, see what kind of file you have:
file plsToBed
This will print the kind of file (including details about the target architecture).
Next, there's no need to copy the file anywhere before trying to run it. If it's in a particular location and you have cd to that location, then simply:
./plsToBed
will execute it from the current directory.
You shouldn't have been able to copy to /usr/local/bin without being root (I hope you're not doing all this as root).
You don't want to add the name of the file itself to the PATH environment variable; the PATH is a list of directories, not files.

OS X - Make returning "Nothing to be done for <filename>"

First of all, I would like to apologize if I'm on the wrong stackexchange network, and secondly, sorry if I'm overlooking something simple.
I was moving files from my old hard drive from an old PC when I came across several password protected ZIP Files. However, since those files were a bit old, I forgot the passwords already. I tried every password I could come up with but I still came up empty. After several google searches, I found this tool/utility for Mac OS X that could help me. So I go to the downloads page and download the Mac OSX utility tool and the source code.
However, I am having problems executing the make command for the file. It says on the downloads page:
If you are using linux or another unix, you need to download the source code, uncompress it and type "make" to compile the utility.
So far, what I've tried is
$make /Users/myname/Downloads/aapr-0.01-source/Makefile
I have also tried the other files in the source folder but nothing worked. After that, I'm pretty much blank. I tried double clicking the aapr file in the utility download for Mac (which is a Unix Executable) and it opens a new terminal window displaying the commands and such. Also, doing $aapr [options] [filename] only shows me -bash: aapr: command not found. I also updated XCodes command line tools.
Sorry if I'm missing out on something very basic, I don't usually use the terminal on the OS X.
Try running
cd /Users/myname/Downloads/aapr-0.01-source
make
A Makefile contains rules for building files from other files but it is based on paths and contents, etc. which depend on your current location. So generally you need to be in the directory of the project for it to work.
Edit (copied from my comment):
To execute a command from a specific location (that isn't in the normal $PATH) you need to specify a path for it. So something like /bin/bash or ./aapr (where ./ means the current directory).

Resources