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.
I set up a Python virtual environment in 'Visual Studio Code'. Here is the full path to my python interpreter:
"C:\Users\Hamid\Desktop\VisualStudio.venv\Scripts\python.exe"
I am creating an Azure function. I have the following files in my folder:
In my requirements.txt file I have the names of the Python packages I need installed for my main Python script. When I run the following command in the terminal:
pip install -r requirements.txt
I get the following message:
Requirement already satisfied: azure-functions in c:\users\hamid\appdata\local\programs\python\python39\lib\site-packages (from -r requirements.txt (line 5)) (1.12.0)
The Terminal doesn't seem to be connected to my Virtual Python environment. How can I set the terminal up so that it connects to the virtual enviornment?.
I came across two suggestions on stackoverflow. I tried to manually set the python interpreter and I also pressed ctrl+shift+' to reset the terminal. Unfortunately both methods did not work for me.
One of the workarounds is to activate the virtual environment and change the function run path to virtual environment folder in the VS Code terminal:
python -m venv .venv
source .venv/bin/activate
OR
set-executionpolicy remotesigned
.venv\Scripts\Activate.ps1
OR
when you open the project in VS Code, you'll get the dialog box like below and click on yes:
and freeze the requirements file using the cmdlet
pip freeze > requirements.txt`
Refer to few of my workarounds SO Thread1 and Thread2 in regards of Virtual Environment activating in Azure Functions
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
I installed Airflow through
pip install apache-airflow
in Conda Promt. It's installed normally, but when i'm trying to launch this command through Conda Prompt:
airflow initdb
It gives me an error that "airflow is not an internal or external command, executable program, or batch file"
How to solve it?
I assume you are running this in windows, you can find more info here: https://stackoverflow.com/a/42510906/840984
In short: Airflow doesn't officially support running on Windows
Unable to run the rasa init command and getting following error:
'rasa' is not recognized as an internal or external command, operable program or batch file.
I have following version of RASA in my environment:
rasa-core 0.13.2
rasa-core-sdk 0.12.2
rasa-nlu 0.14.6
rasa-sdk 1.2.0
Sams answer is right. Rasa is probably not in your environment variable path.
Have you already tried:
py -m rasa init
or
python -m rasa init
If this doesn't work you may find answers at the rasa community forum
Did you try pip based installation as mentioned here
You can do
pip install rasa
If you have already done that I suspect that you need to add rasa in the environment variable PATH
Also are you using virtualenv? or conda environment? I would suggest using that to do the installation.
I had this issue with python 3.9. It worked after downgrading the python version to 3.8. It required recreating my conda environment.
Hopefully you got it working by now, but if not you can either
1) Try setting the Python path in Advanced System Settings > Environment Variables. (ideally we want it in a top-level folder)
2) Re-install Python using the graphical installer. Run the regular Python installer as administrator. BE SURE to click the little ‘Add to PATH’ checkbox, or all this will be for naught!! (For me personally this is a lot easier than manually adjusting the path in environment variables.)
Then choose “Custom install location.” Clicking “Install for all users” should automatically change the install path to the C:Program Files folder.
3) You may also be able to do this without a full reinstall by selecting Programs > Programs and Features > Modify/Repair.
Go to Settings -> Manage App Execution Aliases -> Turn Python Off - since I had both Python and Python3 enabled, the VSCODE was not letting me access the virtual environment I created in the Project Folder. This solved my issue.
Wrong Path in cmd Terminal of VSCODE:
C:\User....\Project>rasa --version
'rasa' was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.
Correct Path in cmd Terminal of VSCODE (after turning off Python in Computer App Settings):
(venv) C:\User....\Project>rasa --version
Rasa Version : 2.3.4
Rasa SDK Version : 2.3.1
Rasa X Version : 0.37.1
Python Version : 3.7.10
The accepted answer says to set the environment variables which made me curious but the problem is I do not know the rasa installation path to set the environment variables.
Step 1:
So I'll write down how I figured this out. First, if you don't have the Anaconda package manager install it from the official website. (While installing click the checkbox to add Anaconda to your PATH environment variable.)
Step 2:
Now open up the anaconda prompt and go to the directory where you want to run rasa.
Step 3:
Then we can create a new conda environment by running conda create --name installingrasa python==3.8.5 to keep all of our dependencies together in a centralized place. Finally activate the environment by conda activate installingrasa
Step 4:
Install UJSON and Tensorflow that will help us to work with rasa.
conda install ujson
conda install tensorflow
Step 5:
Ultimately we can install rasa. Here we are going to install it via pip rather than conda. (there is no conda version fr rasa at the moment I'm writing this)
pip install rasa
Step 6:
In order to run Tensorflow on windows, we need to download visual c++ separately. Find the executable from the official website. And now we can run rasa init without errors and initialize new bot.
try this code while creating a virtual environment
conda create --name filename python==3.8
Looks like this is an issue of python 3.9. After playing around a lot with 3.9, I downgraded my python to 3.8 and it worked without a glitch.
You can create a conda environment with a different python version by using the option python==3.8 in the conda create command line.
The above solutions didn't worked for me.
After a lot of searching I found that rasa was located at C:\Users\tejas\AppData\Roaming\Python\Python36\Scripts\rasa.py (installed using pip install rasa)
As I was working anaconda environment named as(RASA)
I didn’t found rasa.py at C:\Users\tejas\anaconda3\envs\RASA\Scripts nor in
C:\Users\tejas\anaconda3\Scripts
So I just copy pasted rasa.py at these 2 locations and it worked for me in anaconda environment.
You might forget to install the rasa package. You can follow the steps to install rasa on your machine.
Create a new virtual environment named venv
You can also install rasa without virtual environment. but it would be better to track the dependencies if we are in a virtual environment.
python3 -m venv venv
Activate the virtual environment
For windows: venv\Scripts\activate
For Ubuntu: source ./venv/bin/activate
Install rasa package
pip3 install -U pip
pip3 install rasa
For more: Rasa installation
Try this command,
pip3 install -U --user pip && pip3 install rasa
It worked for me, This command will upgrade your pip to the latest version, and rasa will be successfully installed, and check it by typing rasa --version.
If it still doesn't work, download the python 3.7 version using miniconda,set the environment using miniconda, and then install rasa using this command again