I'm trying to learn panda 3d, but I'm getting this error
importerror no module named direct.showbase.showbase
I'm using the latest versions of panda 3d 1.7.2, python 2.7 on windows xp, how to fix the error?
http://www.panda3d.org/forums/viewtopic.php?t=10363
Panda 3D on Windows comes with a special version of python that is preconfigured to work correctly with Panda, that python is run with ppython.
Otherwise you need to add the Panda libraries to your Python path from the Panda install. There is a file called panda3d.pth which has the python path necessary, and you can copy that file to C:\[Python Version]\Lib\site-packages.
I don't know what Panda3d's version of python is, but you will need to be running that if you don't want to use ppython.
Related
I am trying to modify an AI for a game on the steam store. The AI communicates through the game with the use of a mod called the communication mod. The AI is made using a python project. The package I am trying to modify is https://github.com/ForgottenArbiter/spirecomm and the mod is https://github.com/ForgottenArbiter/CommunicationMod.
I want to add the pandas package and the job lib package as imports so I can use a model I have made for the AI. When I try to run the game + mod after adding the pandas and joblib packages as imports I get this error in the error log.
Traceback (most recent call last):
File "/Users/ross/downloads/spirecomm-master/main.py", line 6, in <module>
from spirecomm.ai.agent import SimpleAgent
File "/Users/ross/Downloads/spirecomm-master/spirecomm/ai/agent.py", line 10, in <module>
import pandas as pd
ModuleNotFoundError: No module named 'pandas'
This issue only happens when the game is running and the mod tries to run. if I just run the file in terminal it is able to compile/run and send the ready signal
I have checked that I have these modules installed and it is installed. I am on an M1 Mac and I have several different versions of python installed but I have checked them all and it is installed for each of them. I have also opened the python package using pycharm and added pandas and joblib to the python interpreter as a package.
Another thing I have tried is modifying the setup.py file to say that pandas and joblib are required. I then ran it again but I am not sure if this had any effect because I have already run it before.
There is limited help that can be provided without knowing the framework that you are is using but hopefully this will give you some starting points to help.
If you are getting a "No module named 'pandas'" error, it is because you have imported pandas in your code but your python interpreter cannot find it. There are two major reasons this will happen, either it is not installed (which you say has definitely happened) or it is not in the location the interpreter expects (most likely).
The first thing you can do is make sure the pandas install is in the PYTHONPATH. To do this look at Permanently add a directory to PYTHONPATH?.
Secondly, you say you have several versions of python and have installed the module for all versions but you most likely have several instances of at least one version. Many IDEs, such as PyCharm, create a virtual environment when you create a new project and place in it a new instance of python interpreter, or more accurately a link to one version of python. Within this virtual environment, the IDE then loads the modules it has been told to load and thus makes them available for import to the code using that particular environment.
In your case I suspect you may be using a virtual environment that has not had pandas loaded into it. You need to investigate your IDEs documentation if you do not know how to load it. Alternatively you can instruct the IDE to use a different virtual environment (one that does have pandas loaded) - again search documentation for how to do this.
Finally, if all else fails, you can specifically tell your code where to look for the module using the sys.path.append command in your code.
import sys
sys.path.append('/your/pandas/module/path')
import pandas
I'm attempting to write some Python code using the DigitalCellSorter module (bio statistics-related). One of the methods in this module calls time.thread_time(), which I believe should be present in my Python installation since thread_time() was introduced in Python 3.7 according to this link to the time module description. However, I cannot use from time import thread_time, and when I attempt to run my code I get this error:
AttributeError: module 'time' has no attribute 'thread_time'
Do I need to re-install miniconda3? The only other clue I have is that that same link says that thread_time() is available on Unix systems that support CLOCK_THREAD_CPUTIME_ID (I'm running Catalina on MacOS), but I can't find any information on whether my OS supports that or not.
EDIT: The counts dataframe is a simple .csv with barcodes as columns, and genes as rows (as seen in the expr_df.head() output).
I'm trying to build a python script that is suppose to feed into another Matlab program. the script uses (among other things) numpy and pandas.
Here's the matlab code when I try to load the script:
path='C:\XXXXXX\Local\Continuum\anaconda3\python.exe';
pyversion(path)
algo=py.importlib.import_module('Algo_Pres');
When I try to load the script into matlab, I get an import error that seems to originate from python:
I understand the error as: pandas is missing a numpy dependency.
And yet when I turn back to python and run the script in python it works smoothly...
Where do you think the problem comes from?
PS: I checked my Library using conda list in the Prompt.
For some reason numpy is listed in the anaconda channel, whereas anything else is listed without any channel. Do you think it could be linked?
I'm using Blender 2.78 (64bit) with Python 3.5.2 on Windows 7 (64bit). My situation is that I want to use opencv in combination with python in Blender. I went in serious trouble trying so and was working for days without any obvious success..
However from googling I found that there is a way to install pip as a module for blenders python and with pip I was able to install modules such as numpy oder scipy. This indeed also worked with opencv as it got successfully installed (including positive checks). It looked fine. But as I tried to import cv2 in a Console in Blender I got the error like the thread starter above:
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
File "C:\Program Files\Blender Foundation\Blender\2.78\python\lib\site-packages\cv2\__init__.py", line 7, in <module>
from . import cv2
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.
I then tried to start blender python in an external shell and retried the import process resulting in the same error.
Next was retrying the complete procedure for my system python (same version 3.5.2) and everything worked perfectly.
From now on I was a bit confused as "pypi.python.org/pypi/opencv-python" towards opencv-python states that everything is linked statically and everything you have to do is what I have done. Looking in the FAQ the error is mentioned. You get the advise to check visual c++ redistributable and c runtime library. I did so, however, both is up to date and on system python opencv works perfectly that way.
Next try. As the system python works perfectly with opencv I removed blender python and pasted a copy of the system python instead. According to "blender.stackexchange.com/questions/5287/using-3rd-party-python-modules"
this is an alternative from using blenders own python.
Numpy, Scipy imports work perfectly. Importing cv2 leads to the same error as before.
If I now start the system-python copy that now is blenders python from a command shell cv2 can be imported.
Where is the difference here in the environment blender creates and the one from the shell??
I have installed a tool named listDlls to list all the dlls loaded by specific processes in order to compare blender-python and python. You can see some differences but I dont understand the matter of those except from the absence of the cv2 pyd in blenders python.
Any ideas?
First list is the python-process list, second the blender list:
https://ufile.io/uidy1
https://ufile.io/1eshi
I'm using Mountain Lion at the moment.
I've installed Blender (because it's a dependency of OpenGrasp), and downloaded OpenGrasp. However, I try to load the robot editor up and I get this:
$ python GraspRobotEditor.py
Traceback (most recent call last):
File "GraspRobotEditor.py", line 34, in <module>
import Blender
ImportError: No module named Blender
How do I point Python to the Blender python interface? the Getting Started guide doesn't instruct you much here.
(I'm sure this is a trivial problem to solve but I'd like to see this documented on StackOverflow anyway.)
From the error you it can't find the python module Blender which represents the python hook to Blender. So there could be a few This could be any number of reasons to do with your setup.
The first is that the Blender module is runtime generated whileBlender is running. The specific 'Blender' module used is part of the Blender 2.4x series. According to the link you provided there, they mention porting to newer versions but checking their snv the code is definitely written for 2.49.
Blender 2.49b was the last stable release - http://download.blender.org/release/ Ensure you are using that.
The next thing is whether it can be run via the the Run Script command
TL:DR
Start up blender
Switch to the text workspace
Open the script and see if it can be run directly.
If not you will need to install the folder to the Blender modules directory of your install and then try running it.
Edit: Was looking at into the SVN some more and there does appear to be a version 2 for blender 2.5+ which can be put into a zip file and installed via the add-on installer. According to the bl_info it was build for 2.58 but what support level you would need to try out yourself.