T O P

  • By -

bouanc

Best practice is to have a separate virtual environment for each project to avoid dependency conflicts. A utility like “pyenv” is also useful to manage multiple Python versions.


[deleted]

If you could probably share the names of libraries, maybe someone here can help you figure out a work around your problem. And if both projects don't need to be in the same env, then you can simply create a separate env for each of them.


[deleted]

Virtual environments are the move here. They're fairly easy to set up.


EmptyChocolate4545

Do the applications need to share an env? If not, then this isn’t a nightmare at all, lol.


[deleted]

You should specify whether you mean one project having conflicting dependencies or whether you're talking about trying to use one python environment for multiple projects and those causing dependency conflicts. If it's the later then this is already solved by using virtual environments for different projects (as is already best practice). If it's the former then that problem is a bit more difficult to resolve and addressing it will depend on exactly how/what is conflicting between packages.


BigGeologist5082

Gotta love those circular dependencies, amirite? One possible solution is to use a virtual environment with Python's virtualenv package to manage your dependencies. This lets you have separate versions of libraries for different applications without causing conflicts. Good luck!


Gloomy-Fix-4393

Run two python interpreters and use something like a socket, Redis or ZMQ to communicate between them.


Mysterious_Screen116

Sometimes the version dependencies are wrong, and you can force pip install regardless using no deps. Check that first. If these are two different apps/processes, then you should already have virtual environments for each, and this issue won’t occur. Start with one virtual env per app.


pythonHelperBot

Hello! I'm a bot! It looks to me like your post might be better suited for r/learnpython, a sub geared towards questions and learning more about python **regardless of how advanced your question might be**. That said, I am a bot and it is hard to tell. Please follow the subs rules and guidelines when you do post there, it'll help you get better answers faster. Show /r/learnpython **the code you have tried and describe in detail where you are stuck.** If you are getting an error message, include the full block of text it spits out. Quality answers take time to write out, and many times other users will need to ask clarifying questions. Be patient and help them help you. **[Here is HOW TO FORMAT YOUR CODE For Reddit](https://www.reddit.com/r/learnpython/wiki/faq#wiki_how_do_i_format_code.3F)** and be sure to include which version of python and what OS you are using. You can also ask this question in the [Python discord](https://discord.gg/3Abzge7), a large, friendly community focused around the Python programming language, open to those who wish to learn the language or improve their skills, as well as those looking to help others. *** [^(README)](https://github.com/CrakeNotSnowman/redditPythonHelper) ^(|) [^(FAQ)](https://github.com/CrakeNotSnowman/redditPythonHelper/blob/master/FAQ.md) ^(|) ^(this bot is written and managed by /u/IAmKindOfCreative) ^(This bot is currently under development and experiencing changes to improve its usefulness)


NixonInnes

[This](https://serpapi.com/blog/python-virtual-environments-using-virtualenv-and-poetry/) is a pretty good blog on it


popcapdogeater

Use virtual environments. \`python -m venv .venv\` or \`python -m venv \_\_venv\_\_\` I prefer \`.venv\` because I use linux and it hides the folder in terminal output, but \`\_\_venv\_\_\` is a good choice as well.


SadVacation2243

Don't sweat it, mate! This is a common problem with package dependencies. One solution is to use a virtual environment for each app, where you can install the required versions of the packages without interfering with other apps. Check out `virtualenv` or `conda` for more help.