How to use "make" with Windows and Anaconda? - windows

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.

Related

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/

How do I fix the error I get when executing pip in Spyder 5.0.3

I am getting an error when trying to run pip through Spyder 5.0.3
I have recently installed Spyder 5.0.3 on my machine from https://www.spyder-ide.org/
When I attempt to exectute "pip --version" on IPython in Spyder I get the following error message:
Note: you may need to restart the kernel to use updated packages.
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
How do I fix this so I can run pip in IPython Spyder?
The standalone installer for Windows available in the Spyder website doesn't have pip in it. If you want to use or install a specific package outside of the ones that are shipped with the standalone installer you will need to go with the modular approach to use Spyder (create an environment and select his python executable as the interpreter that Spyder will use).
For that you will need to:
Install a python distribution as for example miniforge: https://github.com/conda-forge/miniforge/tree/4.10.1-3#download
Create a new python environment, install spyder-kernels and the packages you want to use in it.
Set the Spyder interpreter preference to point to the environment created.
The Spyder GitHub wiki has a page that explains the process to setup some of this elements: https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environments-in-Spyder#the-modular-approach

NCO (NetCDF operators) doesnt seem to have installed ncrcat (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

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.

cygwin bash not returning a valid result

I am following this :
Step 2: Installing Cygwin
Cygwin can be downloaded from http://www.cygwin.com
Run the setup file.
Install from internet. Specify C:\cygwin as the root directory.
In the Select Packages dialog box, select the packages required. gcc-core, gcc-g++, gdb, and make packages are most important. These are the C core, C++ core, the GNU Debugger and the GNU version of ‘make’ utility. These packages will be under the ‘Devel’ category.
Complete the installation.
Step 3: Testing Cygwin
To test whether Cygwin was installed properly, try the following by opening the bash shell:
cygcheck -c cygwin
gcc --version
g++ --version
make --version
gdb --version
If the version details are displayed for all these commands, the installation of Cygwin has been successful.
I got this from here
But the result I get is:
What is wrong or missing with my installation.
Follow up question:
I wanted to use the terminal window in netbeans that is why I installed this.
In this terminal widnow I also have problem. I cant type anything on it. Is this the reason for it?
Try to run /usr/bin/g++. If it is not found, then you don't have g++ installed (installation may have had problems).
You can follow the same procedure for the rest of your commands
If /usr/bin/g++ runs successfully, it means you don't have /usr/bin in your PATH (which is very unlikely). You can put that in your PATH in your startup file.

Resources