Where the list of command options and their documentation for Package Mode or Package Management could be found?
cmd [opts] [args]
For example:
st -m Plots GR
where I could read about the option: -m
And the possible options for each command
Interactively, you can use the help command in the package REPL mode:
julia> # type ] to enter package mode
(#v1.5) pkg> help st
[st|status] [-d|--diff] [pkgs...]
[st|status] [-d|--diff] [-p|--project] [pkgs...]
[st|status] [-d|--diff] [-m|--manifest] [pkgs...]
Show the status of the current environment. In --project mode (default),
the status of the project file is summarized. In --manifest mode the
output also includes the recursive dependencies of added packages given
in the manifest. If there are any packages listed as arguments the
output will be limited to those packages. The --diff option will, if the
environment is in a git repository, limit the output to the difference
as compared to the last git commit.
│ Julia 1.1
│
│ pkg> status with package arguments requires at least Julia 1.1.
│ Julia 1.3
│
│ The --diff option requires Julia 1.3. In earlier versions --diff is
| the default for environments in git repositories.
Apart from that, all commands of Pkg's REPL mode (including status or help) are described in Pkg.jl's documentation
Related
is there a way to setup a virtual environment in Julia using an environment file? (for instance like .yml file for creating conda venv)
Julia Version: 1.7.1
OS: Windows 10
In Julia virtual environment is defined via Project.toml file (that keeps package names and their acceptable versions) and Manifest.toml (that keeps the exact dependence tree and package versions generated along requirements defined in Project.toml).
Here is a sample Julia session:
julia> using Pkg
julia> pkg"generate MyProject"
Generating project MyProject:
MyProject/Project.toml
MyProject/src/MyProject.jl
julia> cd("MyProject")
julia> pkg"activate ."
Activating environment at `/home/ubuntu/MyProject/Project.toml`
Finally, note that you can manipulate the Project.toml by eg. adding a package like this (this assumes the environment is active):
pkg"add DataFrames"
Sometimes you want to provide package version information to your Project.toml, for an example you could add at the end of the file:
[compat]
DataFrames = "1.3.0"
After adding the first dependency the Mainifest.toml file has been generated. Copying this file together with Project.toml across machines allows you to duplicate the environment.
In order to have all packages installed on a new machine you will need to run:
pkg"activate ."
pkg"instatiate"
pkg"instatiate" can also be used to generate Mainfest.toml when only the Project.toml is present.
The nice thing is that Julia can store many package versions simultaneously and the virtual environments only links to the central package repository (contrary to Python that copies several GBs of data each time).
pkg provides this with project.toml files.
open julia in console
julia>]
Pkg> activate <Name>
<Name> Pkg> add <PackageName>
create directory with
I want to install the following package from github. I tried using the following command in my environment to install
(nlpEnvJl) pkg> add "https://github.com/yeesian/LeafletJS.jl/tree/master/src"
But I get the following error,
ERROR: could not find project file in package at https://github.com/yeesian/LeafletJS.jl maybe subdir needs to be specified
Any ideas on how I can get installed? Do I have to clone it first to my local repo? If so how do I install from local path?
Cheers
Thanks in advance
You do not need to install locally, but you have to put the URL official to clone it.
add https://github.com/yeesian/LeafletJS.jl.git
Sometimes, if the package is already registered and you only want the master version in github you can directly do
add PackageName#master
You have to clone it locally and then use Pkg.generate in order to import it as a package. It needs a Project.toml file to be added.
Thus, you have to:
$ git clone git#github.com:yeesian/LeafletJS.jl.git
Cloning into 'LeafletJS.jl'...
remote: Enumerating objects: 59, done.
remote: Total 59 (delta 0), reused 0 (delta 0), pack-reused 59
Receiving objects: 100% (59/59), 14.83 KiB | 197.00 KiB/s, done.
Resolving deltas: 100% (22/22), done.
$ julia
(#v1.5) pkg> generate LeafletJS
Generating project LeafletJS:
LeafletJS/Project.toml
LeafletJS/src/LeafletJS.jl
$ cp -r LeafletJS.jl/* LeafletJS/.
$ cd LeafletJS
LeafletJS $ julia
(#v1.5) pkg> dev .
[ Info: Resolving package identifier `.` as a directory at `/tmp/jl_temp/LeafletJS/`.
Path `.` exists and looks like the correct package. Using existing path.
Resolving package versions...
Updating `~/.julia/environments/v1.5/Project.toml`
[b1ddfcb9] + LeafletJS v0.1.0 `../../../../../tmp/jl_temp/LeafletJS`
Updating `~/.julia/environments/v1.5/Manifest.toml`
[b1ddfcb9] + LeafletJS v0.1.0 `../../../../../tmp/jl_temp/LeafletJS`
I am trying to install a github repository and on running as follows
/home/user/.local/bin/python3 -m pip install -e /home/user/repository_folder_name
I get the following error
ERROR: Command errored out with exit status 1:
command: /home/user/.local/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/user/PyMatching/setup.py'"'"'; __file__='"'"'/home/user/PyMatching/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps
cwd: /home/user/PyMatching/
Complete output (54 lines):
running develop
running egg_info
writing src/PyMatching.egg-info/PKG-INFO
writing dependency_links to src/PyMatching.egg-info/dependency_links.txt
writing requirements to src/PyMatching.egg-info/requires.txt
writing top-level names to src/PyMatching.egg-info/top_level.txt
reading manifest file 'src/PyMatching.egg-info/SOURCES.txt'
writing manifest file 'src/PyMatching.egg-info/SOURCES.txt'
running build_ext
-- pybind11 v2.4.dev4
CMake Warning (dev) at lib/lemon/CMakeLists.txt:6 (PROJECT):
Policy CMP0048 is not set: project() command manages VERSION variables.
Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
The following variable(s) would be set to empty:
LEMON_VERSION
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find ILOG (missing: ILOG_CPLEX_LIBRARY ILOG_CPLEX_INCLUDE_DIR)
-- Could NOT find COIN (missing: COIN_CBC_LIBRARY COIN_CBC_SOLVER_LIBRARY COIN_CGL_LIBRARY COIN_CLP_LIBRARY COIN_OSI_LIBRARY COIN_OSI_CBC_LIBRARY COIN_OSI_CLP_LIBRARY)
-- Could NOT find SOPLEX (missing: SOPLEX_LIBRARY SOPLEX_INCLUDE_DIR)
-- Configuring done
-- Generating done
-- Build files have been written to: /home/user/PyMatching
Error: could not load cache
There is a similar question here. But I have tried commenting out #CMAKE_POLICY(SET CMP0048 OLD)
and made sure that I am using the latest version of cmake.
I have no idea how to find these development libraries or find alternatives. Please suggest how to resolve this. Also, this is an issue only on the unix server where I am trying to run this. On my local Windows computer, installation went smoothly.
I'm the developer of PyMatching and I've now added it to the Python package index (see here) so you can install the latest version from PyPI with pip:
pip install pymatching
Since pip will fetch the wheels, which have been built for various platforms, this should hopefully fix your issue, as you won't need to build it yourself.
If you still need to build your own local copy of the PyMatching source code for some reason, just cloning the latest version of the repo might also solve your problem, as I've switched to a more recent version of the Lemon C++ library since you posted.
If this doesn't fix the problem, you could also create an issue on GitHub and/or let me know which version of your operating system you're using.
Is there a Python-like virtualenv environment simulator for Julia where one can do development in a local, virtual environment?
Currently (julia 1.2) is able to manage virual environments via it's builtin Pkg standard library module:
https://docs.julialang.org/en/v1/stdlib/Pkg
julia> ]
(v1.2) pkg> activate tutorial
[ Info: activating new environment at `/tmp/tutorial/Project.toml`.
(tutorial) pkg>
(tutorial) pkg> status
Status `/tmp/tutorial/Project.toml`
(empty environment)
(tutorial) pkg> add Example
...
(tutorial) pkg> status
Status `/tmp/tutorial/Project.toml`
[7876af07] Example v0.5.1
There is Playground.jl
A package for managing julia sandboxes like python's virtualenv (with a little influence from pyenv and virtualenvwrapper)
Nowadays Julia has this kind of thing built into it's package manager, they're called environments and it's described here. It boils down to this, enter the package mangement repl by hitting ], then the command activate $dir switches to the environment described in $dir, then use the instantiate command to install the packages described in the environment.
What's wrong with just having a separate Julia installation in another directory? Then you just need to set the JULIA_PKGDIR environment variable appropriately, for the Julia setup you want to run.
I am looking options to integrate Python 3 tools / scripts to Plone's buildout.cfg (which targets Python 2.6). How eggs between different buildout recipes are shared? Because namely, running setup.py for Python 3 eggs would cause syntax errors in Python 2 environment.
Can I specify Python 3 interpreter (in portable manner) for a buildout recipe like zc.recipe.egg
Will the rest of the buildout happily eat the eggs coming under this recipe using particular Python interpreter, or would it clash with the host environment
... or do one have to create a virtualenv inside buildout itself to get Python 3 stuff installed
You can specify the executable to be used by many recipes, including zc.recipe.egg:
[python3.3]
executable = /usr/local/bin/python3.3
[py3script]
recipe = zc.recipe.egg:scripts
python = python3.3
eggs = py3script
That should install the py3script scripts with python 3.3. The key here is the python key, which points to a section that should have a executable option, which is a path to the python executable you want to use.
The executable key is then used by the easy_install module internal to zc.buildout to run the setup.py script and install the egg.