I need help installing pydasm into python 2.7. The readme.txt file tells me that I have to enter python setup.py build_ext into the cli. When I do, I get the error:
Traceback (most recent call last):
File "setup.py", line 22, in <module>
raise DistutilsPlatformError()
distutils.errors.DistutilsPlatformError
If you can help, please let me know!
Since no one answered my question, I thought I would so if other people have the same issue they can look here for help.
I went to this site: http://ademata.blogspot.com/2010/07/installing-pydasm-and-pefile-module-on.html
Follow these instructions:
Pydasm is included with the module libdasm. An open source fork is available at http://libdasm.googlecode.com/svn/trunk/ svn/libdasm-read-only and requires the use of the subversion tool. To install subversion use sudo apt-get install subversion.
Run the following command to download the latest libdasm code:
svn checkout http://libdasm.googlecode.com/svn/trunk/ svn/libdasm-read-only
Run the following series of commands to install the module on python:
cd svn/libdasm-read-only/
make
sudo make install
cd pydasm
sudo apt-get install python2.6-dev
(use the most recent, so for me I did 2.7)
python setup.py build_ext
sudo python setup.py install
Pefile is included in Ubuntu's repository, to install the pefile module run sudo apt-get install python-pefile.
Hope this helped.
Related
Trying to install Trity-1 and i get a pip error. I'm using Linux. Below is the traceback-
[*] Loading...
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
python3-pip
E: Package 'python-pip' has no installation candidate
sh: 1: easy_install: not found
Traceback (most recent call last):
File "install.py", line 31, in <module>
import pip
ImportError: No module named pip
I don't believe python-pip exists anymore. Try-
sudo apt-get install python3-pip
this is a full setup of trity in kali linux
step by step
try to write this command line
(1) sudo su (for gaining root permission)
(2) git clone the file of trity
link:git clone https://github.com/aymankhalfatni/Trity.git
then
(3)check the present working DIRS
(4)then there you see the trity folder write "cd Trity"
(5)then you will enter the trity folder, there you may see a file named "README.MD"
(6)write the command cat README.MD there willl be a small information on how to install the file of trity
(7)after reading the file go back and write "install.py"
(8)there you may enter the trity app
(9)write 1 for kali linux
(10)if it shows a error check whether you have python installed in your kali linux or not
FOR INSTASLLING PYTHON ON KALI LINUX
(1) write apt-get install python3
(2)if it says its already installed then wirte "apt-upgrade python3"
then the error may be fixed and you can install trity
If there is older version of python ie 2.7.18 remove that
Type >> sudo apt purge -y python2-minimal
install version 3.8 ie latest
Type >> sudo apt install -y python3-pip
latest version of python is installed!
I am on Debian Linux and I am trying to install Pyinstaller, for making a standalone exe file from python script, into my debian linux. I downloaded from this link to get Pyinstaller. But can't find proper installation instruction and found one discussion here.
What I did was
(1) go to the pyinstaller folder and
sudo python setup.py
The error is
Traceback (most recent call last):
File "setup.py", line 14, in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools
(2) I don't have source/linux folder in my Pyinstaller folder according to the discussion in the second link.
Where can I find proper instruction for the installation. Even in this manual, it is not clear how to install for Linux.
Thanks
you need to install python-setuptools
sudo apt-get install python-setuptools
Installation pyinstaller:
You can pip install the pyinstaller
pip install pyinstaller
if you do not have pip then you can install pip using
sudo apt-get install python-pip
I'm using a clean instance of Ubuntu server and would like to install some python packages in my virtualenv.
I receive the following output from the command 'pip install -r requirements.txt'
Downloading/unpacking pymongo==2.5.2 (from -r requirements.txt (line 7))
Downloading pymongo-2.5.2.tar.gz (303kB): 303kB downloaded
Running setup.py egg_info for package pymongo
Traceback (most recent call last):
File "<string>", line 3, in <module>
ImportError: No module named setuptools.command
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 3, in <module>
ImportError: No module named setuptools.command
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /home/redacted/env/build/pymongo
Storing complete log in /home/redacted/.pip/pip.log
Any Idea what's going on?
python version 2.7.3
pip version pip 1.4 from /home/redacted/env/lib/python2.7/site-packages (python 2.7)
Try installing:
sudo apt-get install python-setuptools
if this doesn't work try:
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
Edit: If you have several (possible conflicting) python installations or environments, the following commands can be useful to debug which executables are being used:
which python
which pip
which easy_install
They should "match". It can happen for example that you have pip installing packages for an EPD or global distribution while the current python that is being used corresponds to a local environment (or something different), in which case it might not be able to see the installed packages.
had the same problem, solved it with
pip install -U setuptools
Elaborating #elyase's Answer.
First check for which python version you want to install setuptools.
Normally both python versions comes default with debian or any linux distro.
So, as per your requirement install setup tools using apt package manager
For python 2.x
sudo apt-get install python-setuptools
For python 3.x
sudo apt-get install python3-setuptools
These instructions solved the problem for me:
first enter these commands
pip install --upgrade pip
pip install --upgrade wheel
pip install setuptools
and then try to install the package that requires setuptools.
I'm trying to generate .docx files using Python. I searched the web and posts here and found a module:
https://github.com/mikemaccana/python-docx/blob/master/README.markdown
It says to install using easy_install or pip, which I have no idea how to do. I went to python website to install pip from the instructions given on python documentation:
http://guide.python-distribute.org/installation.html
So I downloaded and followed directions:
$ tar xzf pip-0.7.2.tar.gz
$ cd pip-0.7.2
$ python setup.py install
But when I do python setup.py install, I get error message:
Johns-MacBook-Pro:pip-0.7.2 John$ python setup.py install
Traceback (most recent call last):
File "setup.py", line 2, in <module>
from setuptools import setup
ImportError: No module named setuptools
Can someone please help me install step by step for a newb? Thanks in advance for all of your help!
Pip can install straight from the git repository
You just have to tell him to use git and give him the URL of the git rep
pip install git+git://github.com/mikemaccana/python-docx.git
You will also need to install lxml (as written in the setup.py) and PIL (as you will discover when you try to import the module).
pip install PIL
pip install lxml
pip install python-dateutil
I'm having a strange problem while trying to install the Python library zenlib, using its setup.py file. When I run the setup.py file, I get an import error, saying
ImportError: No module named Cython.Distutils`
but I do have such a module, and I can import it on the python command line without any trouble. Why might I be getting this import error?
I think that the problem may have to do with the fact that I am using Enthought Python Distribution, which I installed right beforehand, rather than using the Python 2.7 that came with Ubuntu 12.04.
More background:
Here's exactly what I get when trying to run setup.py:
enwe101#enwe101-PCL:~/zenlib/src$ sudo python setup.py install
Traceback (most recent call last):
File "setup.py", line 4, in <module>
from Cython.Distutils import build_ext
ImportError: No module named Cython.Distutils
But it works from the command line:
>>> from Cython.Distutils import build_ext
>>>
>>> from fake.package import noexist
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named fake.package
Note the first import worked and the second throws an error. Compare this to the first few lines of setup.py:
#from distutils.core import setup
from setuptools import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
import os.path
I made sure that the Enthought Python Distribution and not the python that came with Ubuntu is what is run by default by prepending my bash $PATH environment variable by editing ~/.bashrc, adding this as the last line:
export PATH=/usr/local/epd/bin:$PATH
and indeed which python spits out /usr/local/epd/bin/python... not knowing what else to try, I went into my site packages directory, (/usr/local/epd/lib/python2.7/site-packages) and give full permissions (r,w,x) to Cython, Distutils, build_ext.py, and the __init__.py files. Probably silly to try, and it changed nothing.
Can't think of what to try next!? Any ideas?
Install Cython:
pip install cython
Your sudo is not getting the right python. This is a known behaviour of sudo in Ubuntu. See this question for more info. You need to make sure that sudo calls the right python, either by using the full path:
sudo /usr/local/epd/bin/python setup.py install
or by doing the following (in bash):
alias sudo='sudo env PATH=$PATH'
sudo python setup.py install
For python3 use
sudo apt-get install cython3
For python2 use
sudo apt-get install cython
Details can be read at this
Run
which python
Thats the path to the python that your system has defaulted too
then go to #tiago's method of:
sudo <output of which python> setup.py install
I only got one advice for you : Create a virtualenv. This will ensure you have only one version of python and all your packages installed locally (and not on your entire system).
Should be one of the solutions.
In the CLI-python, import sys and look what's inside sys.path
Then try to use export PYTHONPATH=whatyougot
Running the following commands resolved the issue for me in ubuntu 14.04:
sudo apt-get install python-dev
sudo apt-get install libusb-1.0-0-dev
sudo apt-get install libsystemd-daemon-dev
sudo pip install cython
This link helped me: https://github.com/trezor/python-trezor/issues/40
Ran into this again in modern times. The solution was simple:
pip uninstall cython && pip install cython
Read like a thousand of these threads and finally got it for Python 3. (replace pip with pip3 if you have that kind of installation, and run pip uninstall cython if you have tried other solutions before running any of these)
Mac:
brew install cython
pip install --upgrade cython
Ubuntu
sudo apt-get install cython3 python-dev
pip install --upgrade cython
Windows (must have conda, and MinGW already in path)
conda install cython
conda install --upgrade cython
That is easy.
You could try install cython package first.
It will upgrade your easy_install built in python.
I had dependency from third party library on Cython, didn't manage to build the project on Travis due to the ImportError. In case someone needs it - before installing requirements.txt run this command:
pip install Cython --install-option="--no-cython-compile"
Installing GCC also might help.
Just install Cython from
http://cython.org/#download
and install it using this command
sudo python setup.py install
Then run the command
sudo python -c 'import Cython.Distutils'
and it will be installed and the error message will disappear.