0

I have a problem.

  • I would like to create/add costume library's for a project in a virtual environment in python with an IDE. Sealed off of the global environment.

How did this problem occurred?

  • I dragged the costum-selfmade- library's to the new project and I started using them/changing them. Because there is a init file in this folder, other projects become dependent on these libraries. I fixed it to change the library's names and added the project extension to it. But this is to dirty for my standards/ not sustainable. So I would like to somehow add these custom libraries to a virtual environment and prevent it from creating unwanted dependencies.

Own research for solution:

  • I have looked up if there is a way to create a library in a global env. No result.
  • Checked the VENV if there is a map with library's/packages. There is one, but I dont know how don't I'm supposed to develop in the virtual environment. If this is the way, please tell me your experience.

Project structure: Main folder project A/ stript folder / transactions_handler(class that helps transactions)

Main folder project B/ stript folder / transactions_handler(class that helps transactions)

problem, the classes in project A that use transactions_handler excidently use the class of project B instate. Very tricky.

Leo Hanhart
  • 61
  • 1
  • 6
  • 1
    Can you post in reference with the code and directory structure ? This is more like a screen play I cannot understand – Kris Mar 02 '22 at 10:51
  • 1
    "I have looked up if there is a way to create a library in a global env", sounds like you want to make your library installable. See https://stackoverflow.com/questions/1471994/what-is-setup-py and https://docs.python.org/3/distutils/setupscript.html as a starting point – Carlos Horn Mar 02 '22 at 11:08
  • 1
    Another link that could help you https://medium.com/analytics-vidhya/how-to-create-a-python-library-7d5aea80cc3f – Carlos Horn Mar 02 '22 at 11:10
  • 1
    Please provide enough code so others can better understand or reproduce the problem. – Community Mar 03 '22 at 06:37
  • Guys, thank you so much for your help. I realy appriciate it. thank you :D – Leo Hanhart Mar 03 '22 at 10:13
  • @Kris I have added Directry example. I don't have the code but what happends is that Transaction_handler is imported where its compied. After that it gets modifyed. After that it start using the libary of an other project. – Leo Hanhart Mar 03 '22 at 10:20
  • @CarlosHorn This is excactly what I need. Thank you very much man. – Leo Hanhart Mar 03 '22 at 10:22

0 Answers0