Is an opam pin project needed when one wants to install an opam project with opam reinstall or 'make'? - opam

I am trying to understand when one needs to pin an opam package.
I am seeing some code that pins a package, e.g., with
command = (['opam', 'pin', '-y']
+ root_option()
+ ['--switch', switch]
+ [coq_package_name, coq_package_pin_path])
And then it tries to reinstall it with:
command: list = ['opam',
'reinstall',
root_option(),
'--yes',
'--switch',
switch,
'--keep-build-dir',
coq_package_name]
Is the pin really needed for the opam reinstallation to work? What might be the rationale to do such a pin before the opam reinstallation?
In addition I am also installing some packages with make and am wondering if that is needed:
command: list = ['make', '-C', coq_proj_path]
My guess based on the related OCaml forum thread (URL below)
The OCaml forum thread says:
As the documentation states, opam pin “allows local customisation of the packages in a given switch” (or “divert any package definition”, in the part you quoted). So, if you do not need to replace an official package definition with your own customization, just use opam install.
In my case, I am downloading the Coq project source and then installing it myself from it -- either with opam install or make. With make I can just pass the direct path. With opam install, the pin command actually "maps" the name to the exact path of the project. So my guess is that in my application (due to using the Coq projects myself) I do need the opam pin.
Related:
(OCaml forum thread) What is the difference between opam pin and opam install, when to use one vs the other?
related, gitissue that inspired this: https://github.com/IBM/pycoq/issues/6

My understanding is that there are multiple ways to install an ocaml package.
opam install uses the ocaml_pkg.opam file. Usually the build command is there and the build is done with opam and made aware to opam. Specific versions can be made according to the official opam repo on the internet too!
opam pin usually installs pkgs that require specific local or online version (e.g. through git commits). Opam will be made the install.
I assume reinstall works similarly to opam install.
Building through source by say cloning pkg/proj and running the build command directly (e.g. if it has a opam file running that or running make in the home of the or some variant of it of make proj/pkg )

Related

VOLTTRON install on rasbian buster

Can I get a tip for installing on rasp buster? Im hung up on the install directions to check the status of the rabbitMQ server. Traceback of bash console:
(volttron) pi#raspberry:~/Desktop/volttron $ echo 'export RABBITMQ_HOME=$HOME/rabbitmq_server/rabbitmq_server-3.7.7'|sudo tee --append ~/.bashrc
export RABBITMQ_HOME=$HOME/rabbitmq_server/rabbitmq_server-3.7.7
(volttron) pi#raspberry:~/Desktop/volttron $ source ~/.bashrc
pi#raspberry:~/Desktop/volttron $ RABBITMQ_HOME/sbin/rabbitmqctl status
bash: RABBITMQ_HOME/sbin/rabbitmqctl: No such file or directory
There are a few tracebacks earlier on the installation...
If it makes a difference or not here is the entire bash console process. The git gist link I just created the name install.py even though its just bash commands copied pasted per install directions...
`pi#raspberry:~/Desktop $ git clone https://github.com/VOLTTRON/volttron --branch releases/7.x`
It looks like there are a couple of different issues going on here:
The issue you quote above (RABBITMQ_HOME/sbin/rabbitmqctl: No such file or directory) is that your shell isn't finding the rabbitmqctl command. It looks like you added the RABBITMQ_HOME environment variable to your .bashrc, but used the string RABBITMQ_HOME instead of the variable expansion $RABBITMQ_HOME when you tried to run the command. Try running it as $RABBITMQ_HOME/sbin/rabbitmqctl status instead.
The rabbitmqctl status command will check the status of the rabbitmq application, but I don't think you've done anything to start it yet (that happens when you bootstrap the platform and/or start the platform configured to use the RMQ broker)
I think that the traces earlier in the installation process are problematic (appears to be the same error hit two different ways), but you just haven't run into them yet. I haven't seen any issues building gevent on the RPi 4 with buster (though it is pretty slow), but the ctypes error makes me wonder if there's an issue with the underlying c library it is trying to build on top of. I did notice that you're getting amd64 erlang packages, are you running Raspbian on an x86 processor? (if so this isn't a permutation we've tried and you may be hitting some package compatibility edge case we haven't seen)
One thing to try is to manually install cython into your virtualenvironment and then try running the bootstrap script again with the virtualenvironment activated. You could also try and pip install gevent==20.6.1 directly in that virtualenvironment (this is what the bootstrap script was doing at the failure point). VOLTTRON depends on gevent, so if that isn't installing the platform won't be able to run.

Installing mongodb-enterprise-server error

Hello guys. Can someone help me about this one? I cant install mongodb because of dependency problem. I already tried updating my linux mint terminal.
dpkg: dependency problems prevent configuration of mongodb-enterprise-server:
mongodb-enterprise-server depends on libcurl3 (>= 7.16.2); however:
Package libcurl3 is not installed.
mongodb-enterprise-server depends on snmp; however:
Package snmp is not installed.
Installing via dpkg -i mongodb.deb will not include additional package dependencies. You should be able to fix your installation by following up with sudo apt --fix-broken install.
Unless you have strong reasons to avoid the standard process I would recommend following the tutorial to Install MongoDB Enterprise by adding the appropriate repo definitions. Adding the normal package repo will also make it easier for you to update to newer minor releases of MongoDB 4.0.x.

ModuleNotFoundError in Spyder

I tried to import the biopython package in Spyder and got the error message:
ModuleNotFoundError: No module named 'biopython'
although biopython is installed.
I also checked the PYTHONPATH: there is a path set into the directory where the packages are stored.
Can somebody help? Did I miss something? Thanks for your help!
If you're using Anaconda, it's best to install all the packages you want from Anaconda if possible. You can check if a package is available with (e.g.):
conda search biopython
When I try that command it shows that biopython is available, so assuming you have access to the standard conda channels you should be able to get it this way.
Assuming you haven't already created a conda environment to work with, start by creating a new one with the packages you want to use:
conda create -n myenvname spyder biopython
where myenvname is the name you want to give the environment - call it whatever you like. If you want to use other packages as well, add their names to the end of this command. Then once the env is completed, activate it:
activate myenvname
or if this doesn't work, on Mac or Linux:
source activate myenvname
and start Spyder in this environment:
spyder
Each time you want to use this environment in future you will need to activate it first. You may also be able to do some of these tasks through the Anaconda Navigator or via Start menu shortcuts but the command line version will always work.
If there's a package you want that isn't available from conda but is available via pip, just use the pip command after creating and activating the environment.
If you are using Anaconda, a solution could be
conda install -c main biopython
following https://anaconda.org/main/biopython.
The official repository page helped me when I got your error message because numpy was not in place.

Can't find dev_appserver.py with gcloud installation

I've installed gcloud by following the instructions on:
https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu
gcloud is in my path at /usr/bin/gcloud, but the package doesn't seem to have dev_appserver.py in my path. Is it installed? How do I run it?
Platform: Ubuntu 16.04
Edit: By running dpkg -L google-cloud-sdk I've found it at /usr/lib/google-cloud-sdk/bin/dev_appserver.py but when I try to run it I get:
This action requires the installation of components: [app-engine-
python]
You cannot perform this action because this Cloud SDK installation is
managed by an external package manager. If you would like to get the
Also not sure why it wasn't added to my path.
I know the original question concerns Ubuntu, but I just wanted to share some notes for macOS/OS X in case it's helpful for someone else.
I installed the google-cloud-sdk via Homebrew-Cask and overlooked the caveats note:
brew cask install google-cloud-sdk
After installing the SDK cask, I installed the Python App Engine component, as #Rodney Jonace mentioned:
gcloud components install -q app-engine-python
Going back to the caveats note mentioned above, I appended the following the my ~/.zshrc file:
source $(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc
source $(brew --prefix)/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/completion.zsh.inc
Opening a new terminal tab, I was able to call the extra Python App Engine scripts (e.g., dev_appserver.py) and use the Zsh completions. Hope that helps!
The following articles were also useful:
http://www.javatronic.fr/tips/2014/10/17/installing_google_cloud_sdk_on_ubuntu_with_oh-my-zsh.html
http://www.rainbowbreeze.it/how-to-setup-a-google-app-engine-python-environment-on-mac-osx-using-homebrew/
The google-cloud-sdk deb package comes with the built-in component manager disabled, which is preventing that copy of dev_appserver.py from working through gcloud. If you update your apt-cache, you can install the google-cloud-sdk-app-engine-python and/or google-cloud-sdk-app-engine-java packages that have just started to be published. Directions here:
https://cloud.google.com/sdk/downloads#apt-get

How do you install OCaml with Jane Street's Core using OPAM?

The simple directions found all over the internet for installing Core using OPAM no longer work. What is the new way to install and use Core?
I think I tracked the problem down to a message on the ocaml-core mailing list about renaming several dependencies https://groups.google.com/forum/#!topic/ocaml-core/Te6LTiNBO08.
Paired down, the widely published installation instructions amount to two steps after installing opam itself:
$ opam install core
$ cat >> ~/.ocamlinit <<EOF
#use "topfind";;
#thread;;
#camlp4o;;
#require "core.top";;
#require "core.syntax";;
EOF
Following these directions result in an error about the "sexprlib.syntax" package missing when using ocaml (or corebuild, utop, etc).
Failing directions can be found in this widely referenced ebook
https://github.com/realworldocaml/book/wiki/Installation-Instructions#setting-up-and-using-utop
and are reflected in directions here on Stackoverflow in questions such as:
Ocaml utop library paths, Core module
What is the new way to set up Core?
opam install core no longer seems to be sufficient since it does not pull in the new syntax packages. I am not sure if this is a dependency bug or not.
The recommended ocamlinit settings also seem wrong.
I found that the core 113.24.00 is defective and all the installation instructions on the net as of this writing are out of date.
Users must make the following corrective steps:
Remove all #require references to packages ending in .syntax from ~/.ocamlinit.
Make your own corebuild script without any references to syntax packages
as found at https://github.com/janestreet/core/blob/master/corebuild.
You may also remove the #camlp4o;; line from your .ocamlinit as this library is no longer required by Core.

Resources