Ruby: cannot install libv8 on Windows 7 : missing python installation - python

my question is too many on Google but I still cannot find the real answer.
First, I run rails server : error missing libv8
I try bundle install and notice that cannot install libv8 library because missing Python.
But I have installed Python before at put it into Path. For example: D:\...:\Python\ : notice that not Python\bin because python doesn't have bin folder.
I have read some tutorial on internet, has tried to install DevKit too, but no result.
Please help me. Thanks :)

Besides the DevKit you need Python to be installed and included in your path.
There are several Python installers for windows on the Python Dowload Page.
My first attempt with Python 3.2.3 failed, because it is not supported by libv8.
My second attempt with 2.7 succeeded!

Related

problem installing and importing modules in python

I am installing python on windows10 and trying to install the opencv and numpy extentions in the command window. I get no error installing them and it says it is successfully installed. But when I try to check the installation and import cv2 it does not recognize it and give me the error: no module named cv2.
can anybody help me with this problem? Is there something wrong in installation process or do I need to install something else?
I checked the newest version of each and used the compatible one with my system.
Thanks.
One solution could be that you have 2 versions of python. So, go to the specific python's scripts directory and run: pip install numpy
If that too doesn't work, you can find the answers to this question on Why can't I import opencv3 even though the package is installed?, as stated by #Cut7er.
I have tried the solutions given to the above stated question myself also. But, they didn't work for me. So, another thing that you could try to use is this IDE called PyCharm. It ofcourse is much more beautiful that the IDLE, but it also has an inbuilt GUI controlled installation of binaries or packages. That would make things a lot easier. I have faced a lot of issues with packages for python and this IDE made things a lot easier. You can find it on https://www.jetbrains.com/pycharm/download/#section=windows.
You can also use anaconda. But, I found it a little difficult to use since, it has similar issues.
EDIT:
Seems like you are using PyCharm. But, you are installing libraries from your command prompt. So, see the answer to: ImportError: No module named 'bottle' - PyCharm. This answer guides you through how to install a certain library through your PyCharm window itself. So,
1) Go to Files>Settings
2) Search for "Interpreter" from the searching tab. Open the interpreter
3) You can now see a plus sign on the right. A click on it will open up a section on the left.
4) In the searching tab, search for numpy or opencv. Click on whichever module you want to install. And then click on the "install package" button on the bottom left. This will install the package for you.
5) Then click save. And run your file that says import cv/cv2.
This should probably do the trick.
Hope it helps!
Is it possible that you have 2 versions of python on your machine and your native pip is pointing to the other one? (e.g. you pip install opencv which installs opencv for python 2, but you are using python 3). If this is so, then use pip3 install opencv
I removed the Anaconda version on my machine, so I just have python 3.7 installed. I removed the python interpreter(Pycharm) and installed it again and the problem got fixed somehow!
I suspect you have two versions of python and the one you're using doesn't have opencv on it, because pip pointed to the wrong one.
A pragmatic solution assuming you're using the python version with conda is to just use conda to install cv2:
conda install -c menpo opencv
A more careful solution is to figure out how to get the pip that points to the python version you're using. On linux I can check that my pip points to my python like this:
:~$ which python
/home/kpierce/anaconda3/bin/python
:~$ which pip
/home/kpierce/anaconda3/bin/pip
So you see the pip and python versions are associated. On windows I suspect you do an analogous thing on the command line like
where python
where pip
And if they don't match, you might try
where python
where pip3
to see if those match. You need to use the pip that points to the correct python version. You can view the python version by entering the python interpreter and running
import sys
sys.version

PYTHONBREW: numpy installed but package not found

I have some pyhton-scripts which are working perfectly on my local computer, but as you would guess, not so good on the server!
I wanted to use "pythonbrew" since at the server I have only Python 2.7.6 installed, but I need hdf5-package running ... OK
I installed pythonbrew (according to https://pypi.python.org/pypi/pythonbrew/) and switched to version 2.7.10 (as I use on my local computer).
Now I got some "numpy-issues". So I installed numpy with pip successfully (according to How do you install numpy when you're not a superuser? and https://gist.github.com/audy/4012573), however, when I am running the programme:
pythonbrew py startup.py
I got the error message saying numpy was not found ...
I really have no clue what I am missing here? I appreciate any help!
I found out myself how to run a python script with pythonbrew properly!
According installation guide for pythonbrew (see: https://pypi.python.org/pypi/pythonbrew/), the following line should be used to run a script:
pythonbrew py myprogramm.py
However, I can run my script by using python instead of pythonbrew py:
python myprogramm.py
I cannot give an explanation for that, sorry. But maybe other people can. It is just working very well like this and I can use python and all packages normally!
Further instructions of how to use pythonbrew, installing or switching between different version etc., see the link to the installation guide I posted above!
More details about pythonbrew and usage (from my perspective of view):
The installation guide I mentioned explains step by step how to install pythonbrew in your home directory (e.g. on a server) and helps to set up python on a system where you are not superuser (e.g. a server where you are allowed to run scripts but not to execute any further installations!).
I had the problem that I needed a more up to date python-version and the server where the data is located is equipped with an older version. The other half of the story is that I also needed some packages (e.g. h5py or cosmolopy) which are also not installed at the server.
For me the easiest and perfectly working solution to that problems was to use pythonbrew and install it at my home directory on the server!

Robot Framework can't find Python

I'm trying to install Robot Framework, but it keeps giving me an error message during setup that "No Python installation found in the registry." I've tried running the installer as administrator, I've made sure that Python is installed (I've tried both 2.7.2 and 2.7.9), and both C:\Python27 and C:\Python27\Scripts are added to the PATH (with and without slashes on the end, if that matters).
I have no idea why it can't find Python. What do I need to do?
Try to add the following path in environment variable also:
"C:\Python27\Lib\site-packages"
Since this path consists all the third party modules installed on your PC and also verify if robot-framework library is present in this folder.
I faced the same issue.
Install a different bit version of ROBOT framework. In my case, I was first trying to install 64bit version but it said "No Python installation found in the registry."
Then I tried to install the 32bit version of ROBOT framework and it worked.
So there is nothing wrong with your Python version.

Installing Pypotrace for python?

Did anybody manage to install pypotrace or is able to install mingwin it's like mission impossible for me I've passed the last 12 hours trying to found out how but nothing is working and description are poor please could any body help? This is where you can get it:
pypotrace web site
This problem was so much of a pain that I ported potrace to python directly rather than using hooks and requiring local compile.
pip install potracer
https://github.com/tatarize/potrace
I implemented the same API as pypotrace so it should be fairly painless.
Since you are working in windows you need the following steps:
You may need the python distutils package - pip install -U distuilts should do the job.
You will also need Cython - the windows installers are here.
You need to install mingw and make sure it is working in
msys mode - run msys and you should get a command prompt in it type
gcc --version and make sure you get a sensible reply.
also make sure your python runs from within msys
Do the required downloads:
potrace source,
agg source site broken or the GitHub zip file here,
potrace source from here and unzip it.
The follow the instructions at the link you gave and tell us where they stop working.

importError: no module named _winreg python3

Where can I download _winreg for python3 if I can at all. I have my 'windir' on E:\Windows. I do not know if cx_Freeze did not notice that. I am using cx_Freeze to create an msi installer.
As it says in the _winreg documentation, it has been renamed to winreg in Python 3.0. You should run the 2to3 tool if you're converting code that was written for Python 2.x.
I know this is an old question, but this was the first search result when Googling for ModuleNotFoundError: No module named '_winreg', and perhaps may be helpful for someone.
I got the same error when trying to use a virtual environment folder, which has been created using different (already deleted) python binaries. The solution was recreate the virtual environment:
Delete the virtual environment folder
Run python -m venv <name_of_virtual_environment>
I have found an easy solution for this, Even though i found it after a lot of Rnd, the solution implementation is so simple and straight forward. Hope it can help many people with the same problem.
If you dont have the latest version of Python installed on your machine, You need to download it from (https://www.python.org/downloads/) and then click on Add to path option and just finish the installer.
Please open CMD and move to the python latest version directory, then run the pip install package name (e.g) pip install pygame and it will be successful
1. C:\WINDOWS\system32>cd C:\Users\admin\AppData\Local\Programs\Python\Python37-32
2. C:\Users\admin\AppData\Local\Programs\Python\Python37-32>pip install Pygame
It will install the packages now without any issues.
Downloading
Successfully installed Pygame-1.9.4
C:\Users\admin\AppData\Local\Programs\Python\Python37-32>
If you are still facing issues in Pycharm after trying the above solution, please try the following steps too.
Create new virtual Environment from settings menu and select the latest version of python framework as Project Interpreter and give a new folder path.
select the pip package you want to import. Recompile the code and the error will clear.
Hope this helps.
When you encounter an error like module of simpleai not found,
use
pip install simpleai
in the prompt and then execute. It will get installed.

Categories

Resources