Python34\Scripts folder configuration after installation - python

In the attempt to get Easy_Install working with Python34 and Python27 I've exhausted the options listed in the documentation.
Is there a way to add the Python\34\Scripts folder so I stop getting the following error?
>>> easy_install numpy
File "<stdin>", line 1
easy_install numpy
^
SyntaxError: invalid syntax
AND
>>> easy_install
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'easy_install' is not defined
>>>

You are running shell commands from the Python REPL, not from the Windows command line. Quit the REPL by typing quit(), exit(), or hitting CtrlD. Open a Windows command prompt by hitting WinR, typing cmd, and hitting Enter. easy_install should now work, although for most use cases (unless you're installing from an egg), pip should be sufficient. It is already installed with Python 3.4 and 2.7.9, and can otherwise be installed by googling install pip and following the first link. pip install numpy is definitely the preferred way to go, as pip supports wheels, which more and more packages (including numpy) are uploading to PyPI.
Alternatively, search Christoph Gohlke's Python Extension Packages for Windows Repository for the package you're looking for. The version of numpy there comes statically linked to Intel's high-performance MKL library, as do a number of numpy-dependent packages like scipy and matplotlib. Simply download the appropriate .whl files from Gohlke's site, run pip install package_name_version_whatever.whl, and you're good to go.

Related

Cannot use the package "openexr" in python within Blender

I've installed the "openexr" package within my windows system. To do this, i used powershell from my blender installation folder "C:\Program Files\Blender Foundation\Blender 3.0\3.0\python" to launch the command ".\bin\python.exe -m ensurepip", for installing pip, and then "pip install openexer" to install the package.
Everything seems fine, but when I open blender and start to code with a simple
import openexr
I obtain this error:
Traceback (most recent call last):
File "\Text", line 1, in <module>
ModuleNotFoundError: No module named 'openexr'
Error: Python script failed, check the message in the system console
The module seems installed, but it's like blender cannot access it. Someone can help me? I would be extremely happy if this could work !
At the moment I tried to re-install pip or the openexr package, but the problem persist.
Also, if I try to re-install openexr, the system answer me that the package is already installed.

Python openglcontext install fails on MacOS 11.6 [duplicate]

I've recently decided to learn OpenGl in python.
I installed PyOpenGL using pip3 install PyOpenGl PyOpenGl_accelerate. I was then about to follow a
tutorial for PyOpenGL. The first item was to install PyOpenGLContext.
I tried to install PyOpenGLContext with both pip3 install OpenGLContext and pip3 install PyDispatcher PyVRML97 OpenGLContext and both gave me the same error:
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/3r/xfny397j6j98y1sjgh_s574m0000gn/T/pip-build-o7zx54vx/OpenGLContext/setup.py", line 10
except ImportError, err:
^
SyntaxError: invalid syntax
So, there's a syntax error there. How do I get around this? If you need more information, please let me know. I am trying to install this on a MacBook Pro (2013) version for Python3.5.
It should work if you download and install the wheel from Unofficial Windows Binaries for Python Extension Packages:
Download the OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl installation file to a an arbitrary directory.
cd to that directory in a command line and install using pip install OpenGLContext‑2.3.0‑py2.py3‑none‑any.whl
It looks like OpenGLContext has not been updated in a while, and thus is not compatible with Python 3.5.
Having a look at https://pypi.python.org/pypi/OpenGLContext yields that the last update was in 2014.
You probably want to either use an older python version, or a different library.

ModuleNotFoundError: No module named 'cryptography'

these are the Error messages I am geeting on running any of my project modules.
Traceback (most recent call last):
File "C:\Users\hsnl\BlockchainCodesTutor\Wallet.py", line 3, in <module>
import Transactions
File "C:\Users\hsnl\BlockchainCodesTutor\Transactions.py", line 2, in <module>
import Signatures
File "C:\Users\hsnl\BlockchainCodesTutor\Signatures.py", line 2, in <module>
import cryptography
ModuleNotFoundError: No module named 'cryptography'
I have already installed the cryptography module and was working perfectly until today I start getting this message that " No module named 'cryptography'".
I have again installed the cryptography as well as pip package but still showing the same error.
There might be loose versions running on your system. Please try the following:
python -m pip uninstall cryptography
python -m pip install cryptography
You can also check out this with python -m to make sure you are not using a loose pip.
You might not have cryptogtaphy installed correctly. I see you are using windows. Open commandline as an administrator and run pip install cryptography again. Enshure that the installation finishes without any errors and consider to restart your python interpreter after installation.
For further help you should post more details like the output of pip and your code leading to the error, so a more detailed answer for your problem can be given.
Try download cryptography whl from here.
Then use pip install cryptography-XXX.whl
For example:
pip install cryptography-3.3.1-cp36-abi3-win_amd64.whl
And now just supports python2.7 and python3.6.

SyntaxError when pip install install NLTK

I am coding on Python 2.7. I want a large list of words to have access to. Looking around, I have found that nltk has what I'm looking for. However, every time I try and install it I get a syntax error. I have tried doing the commands in the shell and in files. I have no true understanding of how pip, install, and download commands work. I am on a mac, which other threads have said could affect things. I have tried...
sudo pip2 install nltk
Which gives:
SyntaxError: invalid syntax
When importing, I get
import nltk
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
import nltk
ModuleNotFoundError: No module named 'nltk'
nltk.download
Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
nltk.download
NameError: name 'nltk' is not defined
and a few other suggestions from other threads, but nothing works. Please help.
pip is your python package manager. It is a command line tool, and not a python function, object or method. This means you can't call pip from within python (at least not by just typing pip ... into a python interpreter). pip should come along with your installation of python 2.7, so you don't need to install it, as long as you have python installed.
You need to call pip from your command line (on a mac, this would most likely be from terminal). So you need to open your terminal, type pip install nltk, which should install your package.
Then, you can start python by using the command python in terminal. You can then import nltk using import nltk.
Only once you've followed those steps, and successfully installed and imported the nltk package, can you use nltk.download() to download nltk data. nltk.download() in itself has nothing to do with installing the package.
I would recommend following a python tutorial, such as the one linked, in order to gain an understanding of how to use the python interpreter. This should explain how to install packages, and use basic python functionality.
Most versions of Mac OS come with Python version 2.7, but not with pip.
First verify that you have pip installed from the command line:
pip -V
If pip is not installed, follow the instructions here:
How do I install pip on macOS or OS X?
Then, directly in the terminal type (not in the python interpreter)
pip install nltk
Then, open your python interpreter from the command line:
python
and in the python interpreter, try importing nltk
import nltk

How do I install Python packages/ wxPython on Mac OSX?

I'm very new to python and any non-basic computer functions in general, but I'm having a very basic problem and I can't figure out how to fix it. Any time I download a module from the internet and try to import it in python, I get an error message. For example, I just downloaded wxPython after being instructed to do so on a tutorial program for Python I've been using, and after entering "import wx" I got:
Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
import wx
ImportError: No module named wx
How do I fix this so that python can find modules I download?
Thanks!!
Python version 2.7.3, and I downloaded wxPython from the download link on the website. Another thing I noticed: whenever I type in python setup.py install in the Terminal, I get:
/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
can't open file 'setup.py': [Errno 2] No such file or directory
Which seems to be another huge problem?
There are a few things you need to do to actually debug this:
Run python and check what version you are running.
type where python and figure out if you have multiple versions of python running at once.
With pip or easy_install, read the output to check where they are installing packages. It's somewhat likely that they are installing to the system-wide Python 2.6, as opposed to the version that you want it to be installed to (Python 2.7).
If you find any packages installed in the wrong place with 3, uninstall them with pip uninstall <packagename> and then specifically reinstall them to 2.7 with easy_install-2.7 or pip-2.7 install. If you don't see the option for easy_install-2.7 or pip-2.7, you need to install distribute and run its setup.py file with the specific version of Python you are using.
Make sure you are actually in the directory when running setup.py. For example, to install distribute, you need to cd into the appropriate directory to install.
Finally, a separate note: it's far easier to install packages with easy_install or pip, as opposed to downloading them separately. You should try doing that first. Again, distribute has more info.

Categories