NCO (NetCDF operators) doesnt seem to have installed ncrcat (Anaconda) - anaconda

So I've installed nco using the following command: conda install -c conda-forge nco which gives me nco version 7.8.1
However, when I try to run ncrcat I get:
ncrcat is not recognized as an internal or external command, operable program or batch file.
Other commands work fine. This suggests ncrcat has not been installed, how do I install that?

The behavior you describe is unlikely unless you are using Windows, in which case the solution is to copy ncra.exe to ncrcat.exe more or less like this:
copy ncra.exe ncrcat.exe

Related

How to use "make" with Windows and Anaconda?

I am attempting to follow this tutorial to learn how to use the Cookiecutter folder structure for data science projects. My machine is running Windows 10 and I am using Anaconda.
It seems that the Cookiecutter project structure relies heavily on Makefiles, as does the above tutorial I am trying to follow.
Is there a way to use make on Windows and while using Anaconda?
What I've tried....
The first step is to check my installations. I open Anaconda command prompt and run each of the following.
conda --version
make --version
git --version
cookiecutter --version
When I run make --version I get the following error. 'make' is not recognized as an internal or external command, operable program or batch file.
When I attept to install make by running conda install -c anaconda make, I get:
PackagesNotFoundError: The following packages are not available from current channels:
- make
Looking at the Anaconda make documentation here, I see it is not available for Windows.
More searching led me to m2w64-make, with documentation found here.
I open an Anaconda command window and install the package using conda install -c conda-forge m2w64-make. Installation appears to run with no errors.
However when I attempt to run this package, nothing happens.
When I run m2w64-make --version I get:
'm2w64-make' is not recognized as an internal or external command,
operable program or batch file.
When I run make --version I get:
'make' is not recognized as an internal or external command,
operable program or batch file.
This Stack Overflow post appears to be very similar at first, but all of the answers tell the OP to use Chocolatey, and do not give an option for Anaconda.
Running mingw32-make --version works.

Cannot run internal or external commands in Jupyter Notebook

I'm trying to run shell commands in the Jupyter notebook but it doesn't work
!which python
It shows an error
'which' is not recognized as an internal or external command,
operable program or batch file.
If you are working on windows based system:
!where python
Else:
%%bash
which python
References:
https://www.shellhacks.com/windows-which-equivalent-cmd-powershell/
https://stackoverflow.com/a/48529220/15488129
Can you run python3 --version. I am assuming you are using Windows. Open your command line and run the command too. If you still get the same response, it means you did not add python to path while installing. Did you install using Anaconda?
If you want to add python to path, just simply follow this link. It's self-explanatory. Let me know in the comment section if you still have issues.
https://datatofish.com/add-python-to-windows-path/

Can't get pip working with psychopy install

I am very new to python and plan to use psychopy quite a lot. I am on a work computer but have full admin rights.
Psychopy came with python version 2.7.11 and includes setuptools already.
I am trying to install the selenium module, but having trouble getting pip to work at all.
In cmd, it is recognising the 'python' command, so I know python is in my path.
I get the message "can't open file 'pip': [Errno2] No such file or directory" from:
python pip install selenium
I get " 'pip' is not recognised as an internal or external command" from:
pip install selenium
When I change directory to where pip is located, I get:
Fatal error in launcher: Unable to create process using '"'
Using pip2 makes no difference.
It seems a simple thing but where am I going wrong with this?!
I never really got to the bottom of this, but this is what I found out and here are the commands that worked for me in Windows. Be aware that I am far from expert!
To run python scripts (*.py) from command line (cmd) then C:\PsychoPy2 and C:\PsychoPy2\DLLs need to be in path. ('Path' contains directories or file extensions that can be more globally accessed, i.e. do not require you to change the prompt to the relevant directories first).
To check, open cmd and either type echo %PATH% or just type python. (If python starts, the line will say >>>. You can exit by typing quit())
To add to path, get properties of computer, then advanced system settings, then environment variables.
To check pip.exe (a sort of installation wizard) is installed, either search for the file, or check C:\PsychoPy2\Scripts for it. This may also need to be in path.
To reinstall the latest versions of pip and setup tools, I went to cmd and typed:
python -m pip install -U pip setuptools
If the same code did not work for other modules (which in my case was due to network access), then I downloaded the wheel file (*.whl) for that module (from their website) and ran the following code:
python -m pip install c:/modulename.whl
These may not be the correct ways of doing things, but they worked for me when I couldn't get other ways to work!
I've just had the exact same issue with the pip install, and a conflict with PsychoPy installations. I think it's because python automatically wants to call on the path that's been set by Psychopy, so it can't get to the 'pip' folders that for me, remain in a temporary/hidden file. This wasn't intuitive for me - on any machine without psychopy python just 'works' when you download it.

unable to run 'aws' from cygwin

I'm using cygwin installed on Windows 10 and trying to access awscli from it.
I used pip install awscli to install awscli. This installed awscli. I then tried to run only aws to see if it is installed and I get the following error:
-bash: /cygdrive/c/Program Files/Anaconda2/Scripts/aws: C:\Program: bad interpreter: No such file or directory
I'm not sure why this is happening. Any help in this regard would be highly apreciated.
This is still an issue even with the latest version of AWS cli. So after some trial and error I found a pretty good workaround that will not make you switch your favorite shell.
First, make sure python is on your PATH. That is from anywhere in the system you can just run python and it work.
Find the aws script and open it for editing (for me it was located in c:\Program Files\Python36\Scripts\aws) and change the hashbang (that would be the first line in the script) to #!python.exe. For me it was set to #!c:\Program Files\Python36\python.exe. That space in the middle of Program Files caused the issue when that path got converted to Linux like path. Changing it to #!python.exe sidesteps the issue.
When you update AWS cli, repeat the workaround.
PS. You could also avoid this issue by installing python somewhere in a folder without spaces in path. That requires to reconfigure your system, so I did not do that myself.
I would install the standard python and ensure it is coming up first in your path with which python and which pip. Path issues like this are due to mixing and matching executables targeting different platforms in my experience. Certain commands do not implement functionality to convert paths from Windows to Linux and back (it appears your specific commands are failing on spaces).
Since you say you are on Windows 10, if you have the anniversary edition, I would recommend Windows Subsystem for Linux over cygwin. You will likely see less Windows issues on WSL since it uses the exact same ubuntu packages you would use on Linux instead of the cygwin port and maps them low level to the NT Kernel.
The Problem comes from "Program Files" having a space. This is something that is related to cygwin (I encountered the same error with git bash on windows). In a script I had something like this:
#!/c/Program Files/some_program/executable.exe
Escaping the space with a backslash or using quotes didn't work.
The solution is to use the DOS' short filename:
Progra~1 for "Program Files"
Progra~2 for "Program Files (x86)"
So my line would turn into:
#!/c/Progra~1/some_program/executable.exe
In Windows:
cd .. to go to home directory which shows pwd as /.
Now, cd to /cygdrive/c/Program\ Files/Anaconda2/Scripts
Now, run: python aws configure
Example:
user#user /cygdrive/c/Program Files/Anaconda2/Scripts
$python aws configure

pip cxfreeze is not recognized as an internal or external command

I don't know what the deal is, but I installed cx_Freeze with pip
pip install cx_Freeze
Pip says that everything is installed into my site-packages folder.
I double checked that cx_Freeze is in the folder and that the folder in on my windows PATH.
But whenever I try to run cxfreeze I get an 'cxfreeze' is not recognized as an internal or external command, operable program or batch file error.
I tried running:
cxfreeze bookit.py --target-dir bookitdir
cx_Freeze bookit.py --target-dir bookitdir
all to no avail. I am not super familiar with windows. I do all my hacking on my macbook, so I'm sorry if this is a dumb question.
Edit: I also confirmed that C:\Python27\Scripts\ is on the path as well. Still no dice.
If python was installed in "C:\Python34\", usually cxfreeze would be installed in "C:\Python34\Scripts". Make sure it was in PATH too.
And cxfreeze.bat should be edited to point to the right exe files.
As the selected answer here just do the following orders:
cd to your python directory and then the Scripts folder, for me it is:
C:\Python27\Scripts
Here just run the following command:
python cxfreeze-postinstall
Now you can use cxfreeze like this:
cxfreeze hello.py --target-dir=your_target_directory
Hint: For 3 DO NOT forget to run cmd as Administrator
I know it's an old question but In Windows 11,
Assuming you've already had the environmental variables set up.
Using Python 3.10
After installing cx_Freeze with pip like this
pip install cx_Freeze
You have to call it like this
cxfreeze <your-python-file>
instead of the usual linux cx_Freeze
This is how windows copy the file, you have to reference it like below, or you could also change the name of the file to the one you normally use in Linux
Now you can enjoy playing Sticky Bubble on Android and relax a bit while it installs and compiles your app :)

Resources