Python Custom Packages
If you have created your own custom python package and wish to use it in Replit there are two options to add it :
This is relatively simple assuming you know how to use PyPI
you can upload your project to PyPI and then load up your repl you wish to use the package in: eg. Python_Repl-:).
once in the repl you can use the shell command:
pip install <package name>
You can use the sys.path method in python to see what directories python searches for packages.
Once you know what directories to use you can use shell command to add it to PATH.
How to do it in python:
then list all of the included directories
for path in sys.path: print(path)
in Replit this should output something similar to the following:
/opt/virtualenvs/python3/lib/python3.8/site-packages /usr/lib/python38.zip /usr/lib/python3.8 /usr/lib/python3.8/lib-dynload
site-packages directory is were the 3rd-party packages are stored so we will use that one.
Replit only shows files things in the
~/<repl-name> directory, so to move our package we will need to use the shell.
to move files in bash you use the
mv <folder/file-name> <destination-path> command. Type the following into the shell:
mv <package-name> /opt/virtualenvs/python3/lib/python3.8/site-packages
You should now be able to use the package in any repl.
#EDIT# I am don't think this still works because of the new package manager but it might (I haven't tested since)
I appreciate you taking the time to discuss it since I have strong opinions regarding it and I want to find out more information about it. Could you perhaps add some details to the post you made on your blog? It will actually be to our collective advantage. bubble shooter
This was a very interesting article. I hope you continue to contribute quality content to the community. I'd like to introduce you to a new game genre that I've come across. A retro games is a game with traditional gameplay that you can enjoy in your spare time.