Python 3.7 altinstall and installing PIP: PyCharm: unix system - linux

I decided to I wanted to test the newest version of Python. I downloaded from source and performed an altinstall so python3.7 (full) in located in usr/local/lib and its executable is # usr/local/bin. I thought an easy way to go about getting modules installed would be to select this executable as my Project Interpreter in PyCharm and use its package manager to install pip and whatnot. However, when I select 3.7 executable as the: Virtualenv Environment it will not allow me to hit 'ok'. Instead a warning at the bottom left of the window says:
Environment location directory is not empty
So I tried selecting the executable as the System Interpreter and it works to an extent. It allows me to hit ok but in the package manager window there is a yellow bar at the bottom that says:
Python packaging tools not found. Install packaging tools
So if I click the link it attempts an install (requires sudo) and then instead of installing, a warning box pops up:
Failed to install Python packaging tools:
ModuleNotFoundError: No moudle named'_ctypes'
So, how do I get PyCharm to use 3.7 s/t I can install modules for it?

Related

How to install wheel package of tensorRT for tensorflow on Windows 10?

From NVIDIA tensorRT documentation I have completed the first 4 steps for zip file for windows.But Now I can't really understand the 5th and 6th step specially where I have to 3 things to get it work for "tensorFlow". I can't understand how to execute this line
python3 -m pip install <installpath>\graphsurgeon\graphsurgeon-0.4.5-py2.py3-none-any.whl
Here is the link: https://docs.nvidia.com/deeplearning/tensorrt/install-guide/index.html#installing-zip
P.S:I am very new to this world of machine learning and TensorFlow.
You need to open a terminal with a python environment.
Press Ctrl+r and type cmd+Enter to open a terminal. You can check if you have the correct Python version by running python --version.
More information about package installing can be found here:
https://packaging.python.org/tutorials/installing-packages/#requirements-for-installing-packages
For install command execution, replace <installpath> by the location, where you installed TensorRT, e.g., if you installed it in C:\Program Files\TensorRT use:
python3 -m pip install "C:\Program Files"\TensorRT\graphsurgeon\graphsurgeon-0.4.5-py2.py3-none-any.whl
This is described in 2) from your link:
Choose where you want to install TensorRT. The zip file will install
everything into a subdirectory called TensorRT-7.x.x.x. This new
subdirectory will be referred to as <installpath> in the steps below.

installation of custom library cdata for python

I would like to install custom library cdata for python. This library enables connection over C4C Hybris.
Unfortunately, system generates the following error while pip list (of anaconda) shows this library installed :
error image
cdata library is installed in anaconda
Faced the same problem while installing a different package, must be because of 2 different versions of python installed in your system. One solution is -
Uninstall Python from Control Panel
Uninstall Pycharm
Reinstall the latest version of both.
Better solution is changing the interpreter for that, you should go to Pycharm --> file> settings> project>project interpreter.
If there is another Python Instance, it should be up there, change it to that one. If its not in the list, click on the button that looks like Asterik/star (next to project interpreter).
CHange the interpreter.
conda update conda
python -m pip install --upgrade pip
No errors will be observed thereafter.
Moreover, read about Anaconda Virtual Envs, it will help you in long tun.

How to install Python package when using Spyder

I have installed this python package called shuttle using git bash. It works fine when I am using it in git bash. But when I am trying to import shuttle from Spyder or even Jupyter Notebook, its showing error -
ImportError: No module named 'shuttle'
Can you please explain why I am seeing this error and how can I fix it ?
Update: What I realise from searching in google, pip install/spyder/anaconda all have different environment. Because I installed 'shuttle' using pip, Spyder doesn't know about it. So now the problem is how do I install the package in Spyder environment or how do I make Spyder recognise that 'Shuttle' is already installed ?
This is how I solved it:
1. Install the package via pip. In your case shuttle
2. Locate the directory where shuttle is installed. You can do that by opening terminal
python
import shuttle
shuttle #displays location of shuttle
3. Now add shuttle to /path/to/anaconda/lib/
reference post: Anaconda: Permanently include external packages (like in PYTHONPATH)

Install OpenCV correctly on macOS Sierra

I am running on macOS Sierra and I have python 3.5.2 installed on my system.
Now I want to use opencv with python. So here is what I did :-
Installed XCode
Installed CMAKE
Downloaded opencv 3.2 and extracted to my Document directory.
Created a new directory called build inside my opencv directory in Document (obtained from step 3)
Opened CMAKE and configured it to run with source as the opencv directory in Document and target as the build directory within it.
Ran the "make" command from "build" directory
Ran "sudo make install"
All these steps completed successfully. Now I go to IDLE 3.5.2 shell and do "import cv2" and then I get the error "ImportError: No module named cv2"
I tried other solutions like pip3 install opencv-python. It removes the import error but I cannot use this because it doesn't support cv2.imshow() (I kind of need it).
Please help me install and configure opencv correctly.
If you are still stuck you can try by brew, did a fresh install some weeks ago and here is the full process.
As opencv cant support python2 & 3 by default install (read further)
brew edit opencv3
in formula edit this part:
if build.with?("python3") && build.with?("python")
# Opencv3 Does not support building both Python 2 and 3 versions
odie "opencv3: Does not support building both Python 2 and 3 wrappers"
end
by commenting it out ( # at start line).
then:
brew reinstall opencv3 --with-contrib --with-python3 --HEAD
if you have cmake.downloader error you need to edit the brew call and remove the --HEAD flag.
This error is just du to a file missing in the head repository (might be fix soon or not).
Also check your site-package/python version
One issue I found was with then name of the .so library created on install. Try renaming it to cv2.so instead of the longer name it starts with.
On my system it's found here:
/usr/local/opt/opencv/lib/python3.6/site-packages
Also, you can confirm that the above site-packages folder is accessible via sys.path.
>>> import sys
>>> sys.path
If not, you can create a .pth file in one of those directories that contains simply the path name of your site-packages folder above.

Installation of tkinter on python3

I'm using Fedora 21. Installed the python3-tkinter package using yum install python3-tkinter. The package gets stored in the /usr/lib64/python3.4 directory. Is there a way to use pip to install tkinter?
Have a virtualenv setup with python3. When I try to run my program within that virtualenv I get:
ImportError: No module named 'tkinter'.
Does it make sense to copy the package directories from /usr/lib64/python3.4 to the site_packages folder associated with the virtualenv?
I was using python 3.3.2 interpreter. Turns out the default packages installed when running the command yum install python3-tkinter are set to work with python 3.4.1 interpreter. Configuring my virtualenv to use the python 3.4.1 interpreter proved to be the solution as the python interpreter was then able to find the required libraries in it's path.

Resources