iPython on Win8 fails to install modules - python-3.x

Please bear with me the total novice of Python 3 and non native English speaker.
I'm using windows 8 in iPython notebook environment, and I have problem installing modules such as Jieba. If you go to its homepage, the English version is in the bottom (however, not as updated as the Chinese version). It says it supports Python 3 as well, so I tried using git as it suggested, but it gave me this (I successfully cloned it before).
Some other things I tried as well
Using cmd to run setup.py
Using pip3 (it's another module I failed to install)
Installing easy_install (same, couldn't install it)
Do I have to use other approaches to install modules cause I'm using iPython notebook? I'm so frustrated. I'm trying to do text mining on some Chinese texts but I struggle so much with this hurdle already.

You've already cloned Jieba into your home directory (~), which is why your second attempt at cloning failed. Enter the jieba directory, and run git pull to sync any changes from the master repo. You can then run python setup.py install in that directory to install the module.
To install pip on Windows, follow the instructions in this question.

Related

Is Kivy installation possible today without building your own wheel?

This link
shows that in order to install Kivy with python3.11, you must build your own "wheel". Unfortunately for me, the above install fails at the "make install" command. "which python" seems to confirm that i am in the correct virtual environment, but i am not certain.
So we know for sure that if, as of today, you have the most recent version of python, which is python3.11, then you must build your own wheel for Kivy.
That stackoverflow link doesnt work for me, so I thought, well I will just install python3.7 or python3.8. Unfortunately www.python.org does not have installers for versions lower than 3.9. www.python.org does have python3.7 and python3.8 available but those versions do not have "macOS 64-bit...installer" available for them. i am reluctant to try a python install manually without the installer.
my reading of the Kivy documentation confirms that Kivy is happy with python3.7 or python3.8.
So for me, because I want to use a python version that has an installer on www.python.org, I cannot install Kivy without building my own wheel. And that installation fails for me.
Any advice?
The answer is YES, Kivy installation is possible today without building your own wheel. Use python3.10 as of today, February 8, 2023. Kivy wheels are already built for phthon3.10. I installed Python3.10 from www.python.org on my mac laptop running Monterey 12.6. Then I followed the Kivy install instructions at www.kivy.org. The instructions worked perfectly and now I can run Kivy apps from the command line. Next step is to synchronize my python IDE with the environment variables that were used to install Python3.10 and Kivy.

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.

PyMesh Installation on Python 3.6 Windows

I am trying to install Pymesh on Python 3.6.
In my first try, I installed through pip, however it installed a wrong PyMesh than I wanted.
It installed the following, https://pypi.org/project/pymesh/, while I wanted https://pymesh.readthedocs.io/en/latest/
I uninstalled it, and tried installing the later PyMesh, however no luck. There were no instructions for windows. I downloaded the source from github. I extracted and pasted it in C:\Python36\Lib\site-packages
Then I ran python3 setup.py build - when an error showed up, I also tried python3 setup.py install, which worked. However, I am unable to do a simple basic command mentioned in the web page: https://pymesh.readthedocs.io/en/latest/basic.html
It is saying pymesh does not have module name load_mesh.
Looking for the process or thoughts on how to properly install pyMesh for Windows.
My go to solution for problems like this on Windows is always to try it in a conda env first. If that fails, use Docker.

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.

How can I install Image class in Python 3 Ubuntu 14.04?

I am trying to use the PIL in Python 3, but there is no way I can make it work. I tried several links, but none of them really helped.
I am using Ubuntu 14.04 and installed IDLE.
Can anyone here, please help me?
Thanks in advance,
sudo apt-get install python3-pil python3-pil.imagetk
You may need to manually remove any left-overs of non-successful installs tried with pip or compiling with setup.py - this will be indicated by conflicting files listed in the error message.
The rule of thumb is: If you want a Python general tool for interactive use, or that provides scripts you will use directly, libraries for small scripts for personal use: you have to install the package built for your system (the .deb) with apt-get, aptitude whatever - unless that Python module is not packaged at all.
For all other uses, you should create a Python virtualenv and install the desired modules inside that virtualenv with pip install <name>. Including the cases Ubuntu does not have the desired Python module packaged.
Regarding PIL there is still another interesting bit: the original PIL had become unmaintained and bit-rot over the years. One of the most proeminent bugs arising from that is exactly it inability to be cleanly installed using pip or easy_install. Another one is that it never was (at least properly) ported to work with Python3. Due to that a fork named "Pillow" was created. It is a drop-in replacement for the orinal PIL - PIP and Easy_install should install "Pillow" and not "PIL".
(NB. I do not know which PIL or Pillow - is packaged by Ubuntu under the "python-pil" names. I suppose and hope it is the actively maintained project Pillow)

Resources