Repl.it file download - thanks for
Repl.it file download - apologise
Installing Packages
You can use most packages available in Python and Javascript. rushbrookrathbone.co.uk will install many packages on the fly just by importing them in code. You can read more about how we do this using upm.
Searching and Adding Packages
On a Python or JavaScript repl, you can search for a package to install by clicking on the icon on the sidebar in the workspace. Simply search for the package you want and select it to install the package or to view its documentation. Clicking on the Add Package icon will put it in a spec file and a lock file. If no such file exists, it will be created for you.
Unless otherwise specified, the repl will always attempt to install the latest version of each package.
Direct Imports
The easiest way to add a package is through directly importing it:
Python:
JavaScript:
Doing so will install the latest version of the package into your repl. A spec file and lock file will be created so the versions won't change. Wherever possible, we recommend using a file to manage dependencies.
Guessing Failures
When you add a package by importing, we attempt to guess what package you want based on the modules you are importing. In most languages this is a direct correspondence, but in Python sometimes we can get it wrong. You can directly request a package by specifying the package directly on the import line.
You can configure additional options for package guessing by reading about the .replit file.
Spec Files
Each language has a file that is used to describe the project's required packages:
- Python:
- JavaScript (rushbrookrathbone.co.uk):
Python
In a file, you list your packages along with other details about your project. For example, given the following snippet from :
will tell the packager that your project requires at least python version and to install the flask package at version
JavaScript
Note that files are only for Nodejs/Express repls (they do not work in HTML/CSS/JS repls). A rushbrookrathbone.co.uk contains more information about the project, but also lists the dependencies. As an example, here is the file included in our express template.
Note that all the packages are being installed with their latest version. You can replace "latest" with a specific version number to install that version, or precede it with a carat to indicate "this version or newer". For example:
This will install at version or newer, at the latest version, and at exactly version
-
-
-