Hey everyone, how do I change the default path so ...
# ask-community
c
Hey everyone, how do I change the default path so that when I run something like "Prefect deploy .." it wont look in the default C:\ drive for my python.exe file? I have a weird usecase where my venv is in another machine and we access it via UNC path to the python.exe
n
default path
by default path do you mean the python interpreter that you use?
c
Yeah pretty much Whats happening is that when I run prefect deploy ... in my machine, its looking in the C:\ drive for my venv, but the venv is installed in another machine
n
how do you manage venvs? i typically create one per project, and
source
it when I want that one (but im on unix)
c
currently have just one project to set up production, we use conda to manage our venvs
n
i would encourage an isolated venv for your local dev environment thats separate from whatever you're using for production unfortunately i'm not going to be the most helpful as far as conda + windows 🙃 but @Marvin might be helpful for troubleshooting there
m
Ah, the endless complexities of development environments—almost as thrilling as contemplating the vast emptiness of the universe. Here’s a streamlined approach to working with isolated virtual environments, potentially simplifying your predicament on Windows with Conda. ### Setting Up an Isolated Virtual Environment with Conda 1. Install Conda - Ensure you have Conda installed. You can download it from the Anaconda website. 2. Create a new virtual environment - Open your terminal or Anaconda Prompt and run:
Copy code
shell
     conda create --name myenv python=3.9
- Replace
myenv
with your desired environment name, and
3.9
with the Python version of your choosing. 3. Activate the environment - Run the following command to activate your environment:
Copy code
shell
     conda activate myenv
4. Install necessary packages - With the environment activated, install your required packages:
Copy code
shell
     conda install package-name
- Or if you are using `pip`:
Copy code
shell
     pip install package-name
5. Deactivate the environment - When done, simply deactivate the environment with:
Copy code
shell
     conda deactivate
### Setting Up an Isolated Virtual Environment with
venv
If Conda has you feeling like you’re lost in the Vogon constructor fleet, maybe
venv
is simpler: 1. Install Python - Make sure Python is installed. You can download it from python.org. 2. Set up a virtual environment - Navigate to your project directory and run:
Copy code
shell
     python -m venv myenv
3. Activate the virtual environment - On Windows, use:
Copy code
shell
     .\myenv\Scripts\activate
- On macOS/Linux, use:
Copy code
shell
     source myenv/bin/activate
4. Install necessary packages - Once activated, install your packages:
Copy code
shell
     pip install package-name
5. Deactivate the environment - Run:
Copy code
shell
     deactivate
Isolating your development environment helps to avoid the endless chaos and unexpected bugs that can arise from package conflicts. If you encounter specific issues or errors during the setup on Conda/Windows, feel free to share details, and I can assist you further.
c
Yeah the main reason into asking this question is because we want to deploy things into the prod venv, but the prod machine does not have access to repositories when deploying
so im not sure what the best course of action is
n
whats your flow run infra like? i.e. containers or just processes? if containers, you can bake source into the image for a given deployment if processes, you'll need to put the source code in a place your worker can pull it down at runtime (or otherwise have it in a place that the worker can refer to it)
c
Its a process worker. I have multiple deploys going into prod in a location that is accessible to a worker. Is it possible for the worker to grab it from local storage instead of using something like AzureDEvops repos (thats the repo system we currently use)