how do I use modules that I've installed from `pip`?
See original GitHub issueA big part of the benefit of a Python to JavaScript transpiler is the ability to use libraries from the Python ecosystem. Obviously, we won’t be able to use libraries that do I/O or depend on C modules, but things like https://pypi.python.org/pypi/deferred or https://pypi.python.org/pypi/attrs or https://pypi.python.org/pypi/six or https://pypi.python.org/pypi/Automat are important to be able to use code consistently between clients and servers. Looking through the documentation, I don’t see any way to go from a Python virtualenv
with all these things installed to a redistributable bundle.
I don’t know Transcrypt well enough to know if this is a feature request or just a documentation request, but I would like to do it.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:18 (10 by maintainers)
Top Results From Across the Web
How to install modules with PIP (and fix it when it fails) - Medium
How to use PIP. Installing modules to python is painfully easy. Simply open up your terminal: Windows — Command Prompt (CMD) ...
Read more >Build a Python Module and Share it with Pip Install - YouTube
What if everyone could use and install your authored Python package just by typing pip install and your module name at the end...
Read more >How to download and install Python Packages and Modules ...
This tutorial covers how to download and install packages using pip. Pip comes with newer versions of Python, and makes installing packages ......
Read more >python - Unable to import a module that is definitely installed
I've just tried this every which way -- setup.py, easy_install, pip -- from pypi and the repo, but I can't get it to...
Read more >How to find Python List Installed Modules and Version using ...
1. Using help() function (without pip): ... The simplest way is to open a Python console and type the following command… ... This...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, thanks for you feedback. Transcrypt is primarily meant to be able to the Python syntax and class base inheritance to build readable, maintainable applications on top of the JS library world. Some elaboration given at http://www.transcrypt.org/introduction.html. It is a niche project situated somewhere between Pypyjs (fully rooted in Python ecosystem) and Brython (largely rooted in Python ecosystem) on one hand and e.g. RapydScript (fully rooted in JS ecosystem, a tin layer on top of JS, no multi inher, no bound func. ptrs)
So it primary design goal wasn’t cooperation with Python libs but seamless coop with JS libs. Having said that, the project got much further in the direction of a complete Python3.5 implementation than I initially expected. It also lacks some essentials, like metaclasses. Nevertheless it should be able to cooperate with a large set of Python libs, probably with small modifications.
I have not yet looked into that, the priority in development currently lies with further adaptation to the JS world by the addition of sourcemaps.
As I proof of concept I did a port of a very tiny part of NumPy, called Numscrypt. It can be pip installed and used from both CPython and Transcrypt. I both installed it without any environment manager and under miniconda (on Linux), which both proved to be unproblematic.
So in principle it’s possible to have a pure Python library installed “in the usual way” and use it both from CPython and Transcrypt.
Admittedly it would be a great benefit if more pure Python libs could be used from Transcrypt. Given the fact that many people use virtualenv or something like it, it would also clearly be a great benefit if it would cooperate with that.
However that’s something I have not looked into at all. Two things will be required:
So: Once I’m done with the sourcemaps, I’ll probably do some experiments, to find out if it’s feasible to make some important pure Python libs available to Transcrypt using a standard installation procedure and something like virtualenv. The outcome may be one of both:
So unfortunately for now I’ll have to refer to PyPyJs (experimental) and Brython (fully functional) if you need a more complete support of Python libs.
An alternative I have not yet mentioned is to port certain Python libs to thin layers on top of comparable JS functionality.
All in all, with the first version out, there’s still a lot to do. Sorry I cannot give you a more conclusive message at the moment, but this is how it stands…
Kind regards Jacques
Transcrypt currently only compiles to JS5. JS6 support will be added with the Python 3.6 compatible version.