Problems with initialize Cuckoo - python

I tryed to install last Cuckoo version on my physical machine Windows 10. And I use python 2.7.16. I have Cuckoo installed and its dependencies too, but I cann't initialize it:
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\cuckoo.exe\__main__.py", line 5, in <module>
File "c:\python27\lib\site-packages\cuckoo\__init__.py", line 6, in <module>
from cuckoo import (
File "c:\python27\lib\site-packages\cuckoo\processing\__init__.py", line 10, in <module>
__file__, "cuckoo.processing", globals(), Processing
File "c:\python27\lib\site-packages\cuckoo\core\plugins.py", line 46, in enumerate_plugins
"review its contents and/or validity!" % (module_name, e)
cuckoo.common.exceptions.CuckooOperationalError: Unable to load the Cuckoo plugin at cuckoo.processing.procmemory: cannot import name XOR. Please review its contents and/or validity!

I finally understood what the problem it was. When there were problems with dependencies, I tryed to install dependencies using command pip install ... but it was mistake. For successful installation of the program you should install Microsoft Visual C++ Compiler for Python 2.7

Related

Python error - cannot import my requirements

I'm trying to use several imports inside of a Python file. However, none of them seem to be imported correctly. I'm using a miniconda environment, and I've tried running Python versions 2.7 and 3.8 .
The following lines cause failures as soon as I run my app. If I comment-out the first couple of lines, I just get the same error about openpyxl instead of dotenv.
from dotenv import load_dotenv
load_dotenv()
from openpyxl import Workbook
I have both of them listed in a requirements.txt file, and I'm able to run "pip install -r requirements.txt" without issues, but I still get errors when I try to run "python -m src.main".
The errors just look like this (below). Any ideas on what else I can try?
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Users/path/a/b/src/main.py", line 2, in <module>
from dotenv import load_dotenv
ImportError: No module named dotenv
... or this:
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/Users/path/a/b/src/main.py", line 5, in <module>
from openpyxl import Workbook
ImportError: No module named openpyxl
EDIT:
Here's some additional information. I'm thinking these paths got corrupted along the way. Can someone tell me the expected output of these commands, inside of a miniconda environment?
(MyEnv2) MyMacbook:my-rep my-user$ which python
/usr/bin/python
(MyEnv2) MyMacbook:my-rep my-user$ which pip
/Users/my-user/opt/miniconda3/envs/MyEnv2/bin/pip
(MyEnv2) MyMacbook:my-rep my-user$ which pip3
/usr/bin/pip3
Note - none of those paths match this one from my errors:
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
Also, here is the output from echo $PATH:
/Users/my-user/.nvm/versions/node/v8.14.1/bin
:/usr/local/bin
:/usr/bin
:/bin
:/usr/sbin
:/sbin
:/Library/Python/2.7/bin
:/Library/apache-maven-3.6.3/bin
:/usr/local/share/dotnet
:~/.dotnet/tools
:/Users/my-user/opt/miniconda3/envs/MyEnv2/bin
:/Users/my-user/opt/miniconda3/condabin
:/Users/my-user/google-cloud-sdk/bin
:/Users/my-user/.nvm/versions/node/v8.14.1/bin
:/Users/my-user/.nvm/versions/node/v8.14.1/bin
I resolved this by removing the following from: /etc/paths:
/Library/Python/2.7/bin
Once I had that line removed, I was able to see (nearly) identical output for which pip, which pip3, and which python. All 3 output the following (with the appropriate app at the end of the path):
/Users/my-user/opt/miniconda3/envs/MyEnv2/bin/python

How can i resolve a pip install error on windows 10?

I'm running Windows 10 with Python 3.7 and Microsoft Visual Studio Code. I want to install some packages I've downloaded (pysimplegui and psycopg2) but every time I try to install I get an error like this in cmd. Even when I type the pip list command
Traceback (most recent call last):
File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\program files\python37\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python37\Scripts\pip.exe\__main__.py", line 9, in <module>
TypeError: 'module' object is not callable
The files are in my programming folder and I've copied them also on the scripts folder but it's not working. Can you please help me ? thanks in advannce
Try using this code
python3 -m pip install library_you_want

rpy2 doesn't work - requires libiconv.so.2

I have a relatively fresh installation of anaconda, in which I installed rpy2 using "conda install rpy2". However, when I try running it, I get this error, e.g.:
> /[dir]/anaconda/bin/python -m 'rpy2.tests'
Traceback (most recent call last):
File "/[dir]/anaconda/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/[dir]/anaconda/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "[dir]/anaconda/lib/python2.7/site-packages/rpy2/tests.py", line 23, in <module>
import rpy2.tests_rpy_classic
File "/[dir]/anaconda/lib/python2.7/site-packages/rpy2/tests_rpy_classic.py", line 3, in <module>
import rpy2.rpy_classic as rpy
File "/[dir]/anaconda/lib/python2.7/site-packages/rpy2/rpy_classic.py", line 5, in <module>
import rpy2.rinterface as ri
File "/[dir]/anaconda/lib/python2.7/site-packages/rpy2/rinterface/__init__.py", line 92, in <module>
from rpy2.rinterface._rinterface import (baseenv,
ImportError: libiconv.so.2: cannot open shared object file: No such file or directory
What is this libiconv.so.2, and why doesn't it work straight from the box?
I think you need to conda install -c r libiconv or perhaps install r-essentials, which contains libiconv.

Getting AssertionError message installing pip on windows 10

After having downloaded get-pip.py attempting to install, and opening cmd window in windows 10 I am getting the following error message when I type pip and hit enter:
Microsoft Windows [Version 10.0.10240]
(c) 2015 Microsoft Corporation. All rights reserved.
C:\Users\adamh>pip
Traceback (most recent call last):
File "C:\Users\adamh\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 170, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\adamh\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\adamh\AppData\Local\Programs\Python\Python35\Scripts\pip.exe\__main__.py", line 5, in <module>
File "C:\Users\adamh\AppData\Local\Programs\Python\Python35\lib\site-packages\pip\__init__.py", line 26, in <module>
from pip.utils import get_installed_distributions, get_prog
File "C:\Users\adamh\AppData\Local\Programs\Python\Python35\lib\site-packages\pip\utils\__init__.py", line 27, in <module>
from pip._vendor import pkg_resources
File "C:\Users\adamh\AppData\Local\Programs\Python\Python35\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 70, in <module>
from pip._vendor import appdirs
File "C:\Users\adamh\AppData\Local\Programs\Python\Python35\lib\site-packages\pip\_vendor\appdirs.py", line 510, in <module>
import win32com.shell
File "C:\Users\adamh\AppData\Local\Programs\Python\Python35\lib\site-packages\win32com\__init__.py", line 6, in <module>
import pythoncom
File "C:\Users\adamh\AppData\Local\Programs\Python\Python35\lib\site-packages\pythoncom.py", line 2, in <module>
import pywintypes
File "C:\Users\adamh\AppData\Local\Programs\Python\Python35\lib\site-packages\win32\lib\pywintypes.py", line 124, in <module>
__import_pywin32_system_module__("pywintypes", globals())
File "C:\Users\adamh\AppData\Local\Programs\Python\Python35\lib\site-packages\win32\lib\pywintypes.py", line 117, in __import_pywin32_system_module__
assert sys.modules[modname] is not old_mod
AssertionError
C:\Users\adamh>
I tried all of the upgrades and such but none of them have been successful. Thank you very much for any help provided. Sincerely, will_learn
First Check if your python is running is properly from command prompt.
Open command prompt and run python it should show your python version else install it properly and add its path in environment variables
Mostly Pip should be already included in Python 2.7.9+ or 3.4+, but if for whatever reason it is not there, you can use the following one-liner.
Download https://bootstrap.pypa.io/get-pip.py and run it with Administrator permission python get-pip.py (If you are on Linux, use sudo python get-pip.py)
You must to add pip's path into Environment Variables. Pip is contained in python's script directory.
Example my case: C:\Python35\Scripts\pip.exe
To add path to environment variables.
Hold Win and press Pause.
Click Advanced System Settings.
Click Environment Variables.
Add C:\Python35\Scripts (Sorry I don't know name of python 3.5's directory) to the Path on System variables.
Restart Command Prompt.
Edit
In another way, you can use pip-Win instead of pip. Read more here: https://sites.google.com/site/pydatalog/python/pip-for-windows

exceptions import SSLError, InsecurePlatformWarning when using pip, python3.4 win32

I installed Python 3.4.0, but I can't use pip. So then I installed pip from python.org. Then I set PATH.
when I use pip, it reports these:
C:\Users\think\Downloads\pip-7.1.2>pip
Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 171, in _run_module_as_main
"__main__", mod_spec)
File "C:\Python34\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
...
File "C:\Python34\lib\site-packages\pip\_vendor\requests\packages\urllib3\conn
ectionpool.py", line 33, in <module>
from .connection import (
File "C:\Python34\lib\site-packages\pip\_vendor\requests\packages\urllib3\conn
ection.py", line 41, in <module>
from .util import (
File "C:\Python34\lib\site-packages\pip\_vendor\requests\packages\urllib3\util
\__init__.py", line 5, in <module>
from .ssl_ import (
File "C:\Python34\lib\site-packages\pip\_vendor\requests\packages\urllib3\util
\ssl_.py", line 4, in <module>
from ..exceptions import SSLError, InsecurePlatformWarning
ImportError: cannot import name 'InsecurePlatformWarning'
Python3.4.0 on Win32
Please assure that you are running pip module that was intalled in the include path of your python version.
You can do this via python -m pip install <somemodule>. If this fails you probably do not have the right module.
Also, you may want to install the modules for current user only, by using python -m pip install --user <somemodule>

Categories