-1

How to make a python package that does not need to be downloaded using pip and other ways.

I need to know how a package works in unity editor, so that i can use it in python.

  • Can you elaborate a bit more? I'm pretty sure this question has been asked before in this site (it seems awfully generic), but in order to point you in the right direction it'd be nice to understand it properly – ibarrond Jun 11 '21 at 14:12
  • Downloading is one option, you can install locally aswell – Alexey S. Larionov Jun 11 '21 at 14:12
  • I will edit it and tell you. Actually i didnt find the answer anywhere else –  Jun 11 '21 at 14:13
  • 1
    Its different so i will edit it so that you understand –  Jun 11 '21 at 14:13
  • "Without pip" is just distributing a ZIP or egg file. If you want to package a full Python interpreter and python scripts (like Unity does), that is the only way you'll not need to download anything else – OneCricketeer Jun 11 '21 at 14:15
  • Question is still a bit unclear because [Unity requires an existing Python installation](https://docs.unity3d.com/Packages/com.unity.scripting.python@2.0/manual/settings.html), which you can install pip into Python2, but it is not required. – OneCricketeer Jun 11 '21 at 14:18

1 Answers1

0

Packages are different from GUI. To create a package, make a folder for example - Package1 .Then make an __init__.py file. You don't need to write anything in this. It can be empty. You just need to name an empty file as __init__.py and then place it in the folder. __init__.py is just used for python to detect that the folder is a package. Then, you can place many more sub-packages or modules in this package.

Refer to this Python Packages

PCM
  • 2,881
  • 2
  • 8
  • 30
  • Thanks for the help. This helped me. I couldnt import without the `__init__.py` –  Jun 11 '21 at 14:24