I have pulled the source code for SfePy from GitHub with the objective of building and running it locally.
I'm running on Ubuntu 20.10 using Anaconda3. I have PyCharm 2020.2 from Jetbrains as my IDE.
When I bring the code into PyCharm I see several errors about missing packages. One of them is in the base.py file:
except NameError:
from IPython.frontend.terminal.embed \
import InteractiveShellEmbed
The IDE tells me that the terminal package is not installed. It is not found when I try to install.
I searched for it at Anaconda.org, but no joy.
This is an active code base. There was a commit made just today.
How can it be that this code won't build? What am I missing? How can I find a replacement so I can build this app?
I got an answer on the SfePy GitHub issues page:
conda install sfepy
brings in all the dependencies. I'm able to successfully run all the unit tests:
sfepy-run run_tests
When I open PyCharm the compilation problems are resolved.
Related
I am using a Jupyter notebook running in VSCode to test some ideas for a work project and I am using a package that is in a private GitHub repo. I encountered certain conflicts with versions of jax and numpy and after some fiddling trying to fix the issues, I simply re-installed said package to make sure I was using the correct versions of all required packages. Everything seemed fine until I re-opened the notebook and found a bunch of Import "<package name>" could not be resolved Pylance.
The imports still work and the code runs, however, PyLance appears not to be "seeing" said package.
I am using a conda Python 3.8 environment and to re-install the package I ran
pip install -e . --force-reinstall
I have also tried un-installing and re-installing the package, as well as creating a brand new conda env, and then installing the package there. Neither of these options worked however and I was stuck with the same issue.
Upon inspection of what is in sys.path I saw a strange entry
'__editable__.<package_name>-<package_version>.finder.__path_hook__'
I know that a colleague (who does not have this issue) does not see anything similar and instead has the correct local path to the package.
I should also note that I have the Python extension enabled, which includes the Jupyter and Pylance extensions as well. I have tried re-installing those extensions as well and that did not solve the issue either.
Edit.
I will add that I only get this PyLance error in notebooks. If I open a regular Python file then all PyLance features appear to be working as expected.
I am trying to compile a c++ code in an conan enviroment, here are details:
Ubuntu 18.04 WSL x86-64
Windowns 10 x64
python 3.7.5
protoc 3.19.4
The project is located at /mnt/c/project
The build directory is located at /mnt/c/build
The build occurs without any errors but when I try to compile with "ninja" it throws an error related to protoc-gen-nanopb, as you can see attached image.
I tried to install a new protobuf from its c++ source, i added the LD_LIBRARY_PATH that was missing, and I have also tried to clean everything and erase all the files and build again. Everything seems to fail. I believe it's related to compatibility between protobuf and my python version, but I am not sure.
Could someone help me understand how to solve it? I am new to ubuntu and stackoverflow and i am sorry if some information is missing. In this case, just ask.
Error 127
After searching everywhere on here I found some solutions to my problem. At first, the error was that I needed Visual C++ 14.0 and that I could get it from a link that didn't work. So, I downloaded Visual C++ Build Tools and got Visual C++ 14.0.23026. That did not solve the problem.
I did some more searching and found that I could install it using wheel. So, I got wheel and got the .whl file from here as shown in the comments of this
post, making sure to get the correct version for my python version (3.6). Running python -m pip install wordcloud-1.5.0-cp36-cp36m-win32.whl worked, it seemed.
However, after restarting Pycharm, the IDE I use to run python files, it still didn't import it correctly. ModuleNotFoundError: No module named 'wordcloud'.
What am I missing here? Thanks!
EDIT: It works outside of Pycharm (just double clicking my python file), but I'd still like it to work in Pycharm.
I have the same problem and I've solved it.
When you create a project, you should choose 'inherit global site-packages
Or
You can use the terminal in the Pycharm to install the wordcloud.
You can also install wordcloud by File->Settings->Project:your project name->Project interpreter.
I just tried to test the newly released version of PySide2 (5.11) on Windows 10, 64 bit version. But the "Hello World" example does not work. I am using Python 3.6 with PyCharm. The interpreter I use is from Anaconda. So I pip installed the PySide2 version and also tried to install via "conda install ..." the older version of PySide2. Both installations worked, but I get the same error message for both libraries.
The error message is popping up in a separate screen saying: "This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem. Available platform plugins are: minimal, offscreen, windows."
So I definitely can see the plugin files in the correct folder. I tried reinstalling. Deleted everything and tried other IDEs. But nothing solved the problem.
Any help is appreciated.
Try This :
import sys,os
import PySide2
dirname = os.path.dirname(PySide2.__file__)
plugin_path = os.path.join(dirname, 'plugins', 'platforms')
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path
# code .......
# .......
If you run the app after having set QT_DEBUG_PLUGINS=1, you should get more info on what is the issue. In my case, I was getting:
QFactoryLoader::QFactoryLoader() checking directory path "C:/Users/xxxxx/AppData/Local/py3/platforms" ...
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
Such a folder does not exist on my machine.
There are a few tickets somehow related to a similar issue (not sure it is the same problem):
https://bugreports.qt.io/browse/PYSIDE-559
https://github.com/pyside/pyside2-setup/issues/57
https://github.com/conda-forge/matplotlib-feedstock/issues/2
https://github.com/conda-forge/qt-feedstock/issues/71
My current working solution is to remove PyQt, qt and sip anaconda packages, then to manually delete a relic qt.conf in the root folder of the environment. After that, the official PyPi PySide2 wheel works fine.
check whether you have this directory or not: C:\Users\your_user_name\anaconda3\envs\your_virtual_env_name\Library\plugins.
If you don't have it, copy the whole "plugin" folder from your PySide2 site-package.
Mine is in here: C:\Users\your_user_name\anaconda3\envs\your_virtual_env_name\Lib\site-packages\PySide2\plugins
and paste the whole folder to C:\Users\your_user_name\anaconda3\envs\your_virtual_env_name\Library
Cheerio,
I am trying to use Assimulo 2.9. on a Mac OS X. For that I downloaded and installed sundials via cmake by creating a builddir to the Download file and ../Downloads/sundials-2.7.0 running
$cmake ../Downloads/sundials-2.7.0
$make
$make install
This should install everything in /usr/local.
It gives me no error warning when doing this. But when I am trying to use assimulo in python, following error message occurs:
from .sundials import IDA, CVode
ImportError: No module named sundials
Any suggestions?
Thank you very much.
The trick was to install everything through homebrew and get the missing sundials.so file. It seems that the current assimulo-2.9 distribution on pypi does not provide this shared object library and therefore triggers this error message.
I got the same error, in Anaconda(Ubuntu 18.04). I installed pyfmi first, and then installed the dependencies (assimulo, sundials) according to the error message. After everything was installed, the pyfmi was not working by running an fmu example.
But i uninstalled all the related software. Then i reinstalled everything with certain order. I found the order of installation matters, which are: sundials --> assimulo --> pyfmi.
Everything is good now.