im trying to install psycopg2 to use postgres on my django app. Seems like the first step is to run the
sudo apt install python3-dev libpq-dev
, but when i do it hits me with this funky error -
Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk-15.jdk/Contents/Home/bin/apt" (-1)
I'm confused as to why its showing me a java error when i'm installing python-dev. Any help would be greatly appreciated!
Install pip by typing:
python3 -m pip install --user --upgrade pip
It is often a good idea to use virtual environments when doing projects, otherwise packages are installed system wide.
Type in the following to start a virtual environment in your project directory:
python3 -m pip install --user virtualenv
python3 -m venv .
Afterwards, this command should install psycopg2
pip install psycopg2-binary==2.8.4
Related
I am trying to create a Docker container for a micro-service in SpringBoot Java in Ubuntu 21.10, but when I try to build the container I get this error, maybe it is a common error, but so far I can't solve it, I have checked some posts on Internet but had no luck finding a similar solution. Please I would really appreciate the help! Thank you in advance
This is my Dockerfile:
FROM ubuntu
RUN yum install -y java
VOLUME /tmp
ADD target/microservice-0.0.1-SNAPSHOT.jar app.jar
RUN sh -c 'touch /app.jar'
ENTRYPOINT ["java", "-Djava.security.egd-file:/dev/./urandom","-jar","/app.jar"]
This is the error I get:
docker build -t spring_boot_docker .
Sending build context to Docker daemon 17.72MB
Step 1/6 : FROM ubuntu
---> 54c9d81cbb44
Step 2/6 : RUN yum install -y java
---> Running in a2793e79925b
/bin/sh: 1: yum: not found
The command '/bin/sh -c yum install -y java' returned a non-zero code: 127
In ubuntu you can try installing with apt-get:
RUN apt-get update && \
apt-get install -y openjdk-8-jdk
I want to create an image of openjdk15 and python
I am trying the Dockerfile for buid
FROM openjdk:15
RUN yum install -y oracle-epel-release-el7
RUN yum install -y python36
But when i try to build the image it shows
/bin/sh: yum: command not found
The command '/bin/sh -c yum install -y oracle-epel-release-el7' returned a non-zero code: 127
I checked the image also
$ docker run --rm -it --entrypoint "" openjdk:15 sh -c "cat /etc/os-release"
NAME="Oracle Linux Server"
VERSION="8.3"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="8.3"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Oracle Linux Server 8.3"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:8:3:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 8"
ORACLE_BUGZILLA_PRODUCT_VERSION=8.3
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=8.3
It seems that yum is not available on this image. It uses microdnf as package manager. Simply use following dockerfile to install python 3.6 :
FROM openjdk:15
RUN microdnf install python36
After building and running a container with shell process I received :
bash-4.4# python3 -V
Python 3.6.8
I am trying to Dockerize a system where I should run bash script, which calls python3 script and then jar file. But openjdk Docker base doesn't come with python, and its container doesn't seem to support ubuntu based apt-get install commands. Any suggestions ?
You just need to use the java container based on buster instead of buster-slim. openjdk:buster
To test it run the following
docker run -it openjdk:buster /bin/bash
apt update
apt -y upgrade
apt -y install python3
I have to run Django CRM in my local machine. I followed all commands and tried to install every dependency.
I got stuck in the following command.
sudo apt-get install oracle-java8-installer -y java -version
I got the following error when I tried above command.
E: Command line option 'e' [from -version] is not understood in combination with the other options.
The link of Github CRM Django CRM
Documentation
Please someone help me.
Looking to Django-CRM documentation, seems like the command to install java (required by elasticsearch dependency) it's not the correct one for ubuntu 18.04
To install it you need to run:
apt-get install openjdk-8-jre-headless
Then you can follow the instructions as in the documentation
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch > key.elastic
apt-key add key.elastic
echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list
apt-get update && apt-get install elasticsearch -y
Also, remember to add sudo on the commands if you are not running the commands as root
I am using the machine image available here to host an RStudio server off of EC2 on which I will want to run analysis, in part using xlsx and rvest, both of which require Java and R to cooperate which they do not out of the box. I searched for a few solutions and tried to implement them, but got pretty much nowhere.
I SSH'd into the machine, and entered java -version and got this:
The program 'java' can be found in the following packages:
* default-jre
* gcj-5-jre-headless
* openjdk-8-jre-headless
* gcj-4.8-jre-headless
* gcj-4.9-jre-headless
* openjdk-9-jre-headless
Try: sudo apt install <selected package>
so I'm not sure what to do with that. I tried running sudo apt-get install r-cran-rjava which was also recommend on StackOverflow, and got this error:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package r-cran-rjava
and likewise when I try to run sudo R CMD javareconf this is what I get:
*** JAVA_HOME is not a valid path, ignoring
*** Cannot find any Java interpreter
*** Please make sure 'java' is on your PATH or set JAVA_HOME correspondingly
I searched for Java it's stored here: java: /usr/share/java and I'm not sure how to set JAVA_HOME correctly, or how to set Java correctly.
What should I do?
Installing RJava (Ubuntu)
First, we need Java itself, check if it's installed
Write in Terminal: java -version
but you already checked it, so you need to install it.
If it returns The program java can be found in the following packages, then Java hasn't been installed yet, so execute the following command: sudo apt-get install default-jre. This will install the Java Runtime Environment (JRE).
Then Install JDK
Write in Terminal: sudo apt-get install default-jdk
Then assotiate the JDK installed with R
Run in Terminal: sudo R CMD javareconf
Install RJava and Rgdal
Execute: sudo apt-get install r-cran-rjava
Then: sudo apt-get install libgdal1-dev libproj-dev
Install package in RStudio
Run in RStudio: install.packages("rJava")
Done!