I have a virtual environment set up with python 3.6. I'm trying to install sqlite3 (I built python from source) and am having trouble doing so. (I need sqlite3 for tensorboard)
After some digging I found an approach:
sudo apt-get install libsqlite3-dev
Now in the downloaded python source rebuild and install python with the following command:
./configure --enable-loadable-sqlite-extensions && make && sudo make install
The issue is I cannot run the first command. Running the first command gives me the error "download failed Oracle JDK 6 is NOT installed." Therefore I downloaded the libsqlite3-dev file.
My question is, where should this be placed before I can run step 2.
I've looked around for a solution for a few hours now ans seem to be at a loss. Any help would be really appreciated with either solving this approach or proposing another approach.
Use Anaconda
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
conda create -n envsq python=3.7
source activate envsq
python
And you can import sqlite3 with no issues.
Related
While installing LabelImg in M1 Mac using below command
pip install pyqt5 lxml
This is the error I got
ERROR: pyqt5 from https://files.pythonhosted.org/packages/7c/5b/e760ec4f868cb77cee45b4554bf15d3fe6972176e89c4e3faac941213694/PyQt5-5.14.0.tar.gz#sha256=0145a6b7de15756366decb736c349a0cb510d706c83fda5b8cd9e0557bc1da72 has a pyproject.toml file that does not comply with PEP 518: 'build-system.requires' contains an invalid requirement: 'sip >=5.0.1 <6'
How to install lableImg annotation tool in M1 Mac?
I got it to work by using the following commands
brew install pyqt#5
pip install labelimg
And that's it, it just works
You just need to type labelimg in the Terminal and the app will start running
I don't know why they don't tell you this in the installation guide
Alrighty!
On MacOS Monterey, none of the other solutions posted here solved this problem for me. However, I managed to easily solve the issue, without a virtual environment or too much fiddling about like so:
Firstly, you have to download all labelImg packages from this link:
https://github.com/tzutalin/labelImg#macos
(You can download it as a .zip file or clone it)
Unzip and then in your terminal cd into whatever directory you downloaded the above files to.
Then run the following commands in order:
pyrcc5 -o libs/resources.py resources.qrc
Then,
pip3 install lxml
Finally,
python3 labelImg.py
It should run without an issue now.
You can go one of two ways:
Using brew:
You can use homebrew to install the dependencies - like qt and libxml2. This will let your package manager handle everything and generally should solve the problem with the . Then you can run
python3 labelimg.py
Using Virtual Environments:
This is the more recommended way to go about in such cases. You can use conda, pipenv or venv to create a virtual environment which is isolated from your system python installation. Then you can try to install it as explained in the README.rst in the root of the repository:
brew install python3
pip3 install pipenv
pipenv run pip install pyqt5==5.12.1 lxml
pipenv run make qt5py3
pipenv run python3 labelImg.py
[Optional] rm -rf build dist; python setup.py py2app -A;mv "dist/labelImg.app" /Applications
You can try the two methods and and get back with the errors if there are any.
This is my note.
I just succeed on my Mac M1 Chip
CHECK THIS OUT!
Installation of labelimg on mac m1 chip
my first reference
my second reference
First, you must use terminal with rosetta version
Then, you already have python3
Then...
[Done]
# check where python3 is
$ where python3
# create env
$ /usr/bin/python3 -m venv env
# check env is
$ where env
# activate env list
$ source env/bin/activate
# updated to the newest
$ pip install --upgrade pip
# installation of PyQt5
$ pip install PyQt5
# start to run labelImg.py
$ cd Documents/repos/labelImg
$ pip3 install pyqt5 lxml
$ make qt5py3
# [run ok!!]
$ python3 labelImg.py
Using Conda
Create a virtual environment in conda and activate it
conda create -n venv
conda activate venv
Install pyqt using conda
conda install pyqt
Install lxml using pip
pip install lxml
Change directory to the downloaded/cloned labelImg folder
cd path/to/labelImg/folder/
Make qt5py3
make qt5py3
Run LabelImg
python labelImg.py
sudo apt-get install python3.7
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3.7 is already the newest version (3.7.10-1+bionic2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
N: Ignoring file 'security' in directory '/etc/apt/sources.list.d/' as it has no filename extension
root#ubuntu:~# python3 -V
Python 3.6.9
I presume you are a Linux user. I faced a similar issue when I was trying to install Python
3.9 but when I ran python -V in the terminal, it would tell me I had version 2.
I can't guarantee
this will work but it worked for me. If you are using Ubuntu 20.04 a Linux distro, by default you have Python 3.9. In Ubuntu 18 and 16 there is also a Python version pre-installed. In your case, you need to first uninstall Python 3.
Using this command in the terminal.
sudo apt-get remove --purge python3
After uninstalling, reinstall as Python 3.9 version using this command:
sudo apt update
sudo apt install software-properties-common
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.9
python3.9 --version
Again if you're using an editor like Pycharm your base interpreter will be messed up! So please be careful when uninstalling.
And this code works on Ubuntu which I presume is what you are working on.
Another thing you need to install a repository to get Py 3.9. it's called deadsnakes I've mentioned the code above on how you could install it.
I hope you faced no issues. Remember it worked for me but I'm not sure it will work for you. Enjoy with Python 3.9 if the installation is successful :)
After many different ways of trying to install jupyter, it does not seem to install correctly.
May be MacOS related based on how many MacOS system python issues I've been having recently
pip install jupyter --user
Seems to install correctly
But then jupyter is not found
where jupyter
jupyter not found
Not found
Trying another install method found on SO
pip install --upgrade notebook
Seems to install correctly
jupyter is still not found
where pip /usr/local/bin/pip
What can I do to get the command line jupyter notebook command working as in the first step here: https://jupyter.readthedocs.io/en/latest/running.html#running
Short answer: Use python -m notebook
After updating to OS Catalina, I installed a brewed python: brew install python.
It symlinks the Python3, but not the python command, so I added to my $PATH variable the following:
/usr/local/opt/python/libexec/bin
to make the brew python the default python command (don't use system python, and now python2.7 is deprecated). python -m pip install jupyter works, and I can find the jupyter files in ~/Library/Python/3.7/bin/, but the tutorial command of jupyter notebook doesn't work. Instead I just run python -m notebook.
My MacOS has python 2.7, I installed python3 with brew, then the following commands work for me
brew install python3
brew link --overwrite python
pip3 install ipython
python3 -m pip install jupyter
You need to add the local python install directory to your path. Apparently this is not done by default on MacOS.
Try:
export PATH="$HOME/Library/Python/<version number>/bin:$PATH"
and/or add it to your ~/.bashrc.
Try solving this with Conda or Poetry.
Poetry makes it a lot easier to manage Python dependencies (including Jupyter) and build a virtual environment.
Here are the steps to adding Jupyter to a project:
Run poetry add pandas jupyter ipykernel to add the dependency
Run poetry shell to create a shell within the virtual environment
Run jupyter notebook to to fire up a notebook with access to all the virtual environment dependencies
The other suggested solutions are just band-aids. Conda / Poetry can give you a sustainable solution that's easy to maintain and will shield you from constant Python dependency hell.
I installed wordcloud via conda in Windows 64
conda install -c conda-forge word cloud
but that is python 3.4.
I want to install word cloud in python 3.6
but i did search the google.
but it is not effect. so please teach me....
Anaconda Python 3.6 version
For Windows
==== Installation of wordcloud package ====
download wordcloud‑1.3.2‑cp36‑cp36m‑win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud
Copy the file to your current working directory
Open command prompt from Tools
python -m pip install wordcloud-1.3.2-cp36-cp36m-win_amd64.whl
It should work now
For MAC
pip install wordcloud
There is a solution, you can download a third party package for Python 3. Following the below steps helped me solve the problem.
Wordcloud_successful_install
Download wordcloud‑1.3.2‑cp36‑cp36m‑win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud
Copy the file to your current working directory
Open command prompt from Tools
Python -m pip install wordcloud-1.3.2-cp36-cp36m-win_amd64.whl
This will work:
1. create virEnv: conda create -n yourenvname python=3.5 anaconda
2. source activate yourenvname
3. conda install -c conda-forge wordcloud
Install wordcloud from the following page:
https://pypi.org/project/wordcloud/
Note: command: pip install wordcloud
Note: run the above command in Anaconda cmd prompt
Pre-requisities for instaling wordcloud is to install Visual C++(I got this error to install. So, you may give a try).This requires almost 4GB space. Once installed, restart your machine and then try the 1st step. It should be successful this time.
Ok. I solved my issue using wheels. Here are the steps:
Download the .whl file compatible with your Python version and your windows distribution (32bit or 64bit) from here https://www.lfd.uci.edu/~gohlke/pythonlibs/#wordcloud
cd to the file path
Run this command python -m pip install
Where can I install Rscript from? I need to run an R script from a php file using exec. However I need to install Rscript first.
The main package for R is called r-base. For the scripting and command-line front-end see littler (or r-cran-littler in xenial (16.04LTS) and beyond):
sudo apt-get install littler
Search the ubuntu repositories. Have you checked the littler package?
The answers posted so far are generally useful, but they don't directly answer the question. I recently had the same question and discovered there is no rscript binary for Ubuntu. The r binary itself is used to execute scripts in batch mode as opposed to the separate rscript binary that I was using in OS X.
It appears you may be able to get an rscript binary from other sources (see http://craig-russell.co.uk/2012/05/08/install-r-on-ubuntu.html#.UwKWzkJdW2Q for example), but I'm not sure why you would need that when simple running "r script.r" from the command line works just fine.
I tried running Rscript in a fresh ubuntu installation (16.04.2 LTS) and got:
The program 'Rscript' is currently not installed. You can install it by typing:
sudo apt install r-base-core
so, naturally, i ran sudo apt install r-base-core.
installation took a couple of minutes.
Later, i needed to install an R package, and realized i needed an R shell for that. running r returned:
The program 'r' is currently not installed. You can install it by typing:
sudo apt install r-cran-littler
Again, i followed, this time it was quite faster.
I don't know if these are the correct steps to take (or why they would be wrong), but it's what the system led me to do.