Python wheel installed successfully but unable to import modules - python-3.8

I have a myFunction.pyd file which I have tested to make sure that modules defined internally are accessible.
I then created a wheel file myFunction-1.0-py3-none-any.whl
Finally using cmd prompt I installed the wheel file. I can then also see the following location:
C:\Program Files\Python38\Lib\site-packages\myFunction-1.0.dist-info
However, when I do the following import myFunction as mf it gives error ModuleNotFoundError: No module named 'myFunction'
Only thing I can think of is I didn't do anything with the pyd file that I had generated. Do I need to also move that file to some location?

Related

PyInstaller Executable File: ModuleNotFoundError - Pandas

Background: I have a .py script which uses c.10 libraries/dependencies (e.g., pandas numpy json) and the script also relies on a .ini file, which it looks for in the same dir as it is located.I want to add this .py file to Windows Scheduler, but before I can, I must make the file executable.
Issue: I used PyInstaller to create an executable file. I also added -- onefile and -w when creating the .exe file. My issue is that when I attempt to run the main.exe (either by double-clicking or through cmd) I get the following Unhandled exception in script -
Help: I am trying to understand how this is happening, especially as my understanding of PyInstaller is that it would create an executable file, which would inc. everything the script needs to run (Note: I have double checked that the .py contains import pandas etc.
Can someone explain to me how I would troubleshoot this and/or if there are any key steps I may have obviously missed, which might be causing this?
Try using this commandline for compiling your python file, pyinstaller.exe --onefile --noconsole --hidden-import pandas {Your_FILE_NAME}.py

ModuleNotFoundError: No module named 'printSoln'

because its turn out like this
from printSoln import *
ModuleNotFoundError: No module named 'printSoln'
Im using printSoln how can i install that?
As I know there is not any module named printSoln. This may be some custom .py file that has the functions which are used here.
I found one of its types file on GitHub: https://github.com/mateuv/MetodosNumericos/blob/master/python/NumericalMethodsInEngineeringWithPython/printSoln.py
you can download and write that code and save it in the same folder in which your code file exists.

How to add a new module to existing Kamailio Server?

I am using a Kamailio 4.4 server. And I would like to install http_async_client module to this server. I have looked on the module directory(/usr/local/lib64/kamailio/modules) to check wheather this http_async _client module already exist there, but it was not there.
And I searched for a solution and only found the method to include new module at the compile time.
I could find the modules source code on GitHub. But I don't know the steps to install a new module to the existing Kamailio.
Update: I have tried with running the two commands below from directory /usr/local/src/kamailio-4.4/kamailio. but got the following error
make modules-cfg include_modules="http_async_client"
make modules
Errors are:
CC (gcc) [M http_async_client.so] async_http.o
async_http.c:42:26: fatal error: event2/event.h: No such file or directory
compilation terminated.
../../Makefile.rules:97: recipe for target 'async_http.o' failed
make[1]: *** [async_http.o] Error 1
Makefile:511: recipe for target 'modules' failed
make: *** [modules] Error 1
Steps to load new module to Kamailio server. ( It may not be a direct way to do, but it works)
Check the modules is exist in the default module directly /usr/local/lib64/kamailio/modules.
If found, add loadmodule "module_name.so" in load module section in kamailio.cfg file.
If the module is not found in default module directory, you can check for the source code of that module in the default module source code directory /usr/local/src/kamailio-4.4/kamailio/modules.
If source code found, enter to the module directory. Then create modules' shared object file(.so) by following commands.
./configure
make
make test
make install
Then you will get a shared object file(.so). Copy that file into the default module directory. and load this module from the kamailio.cfg file as mentioned in step 1.
If module source code does not exist in the default source code directory, You need to download the source code from the web. And follow step 3 and 4.

Tensorflow(GPU) in sublime text 3

I tried to install tensorflow and finally got there.
I got an error:
ImportError: libcudnn.Version: cannot open shared object file: No such
file or directory
while I was installing but I could handle it. I think it works fine in terminal.
However, the problem is when I tried to import tensorflow in sublime text, it spits the same error.
ImportError: libcudnn.so.6: cannot open shared object file: No such
file or directory
Cause I changed the build system path to /home/username/.conda/envs/tensorflow/bin, I can't understand why I get this error here.
Is there anyone who can help me?
As it is working from terminal I think everything like cuda, cudnn and GPU drivers are setup properly and the export path is added to the .bashrc (~/.bashrc) file. That's why running from terminal works. As adding the export information to only .bashrc file will make it work on terminal but won't help for other programs like sublime.
So, I suggest, you take the export information from .bashrc file and add it to /etc/environment file. You need to log out from current user and login again so environment variables changes take place. The export information on .bashrc file should look something like this.
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64\${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}

Package org.pdfbox.pdfparser does not exist

There is following portion in my code:
import org.pdfbox.cos.COSDocument;
import org.pdfbox.pdfparser.PDFParser;
import org.pdfbox.pdmodel.PDDocument;
import org.pdfbox.pdmodel.PDDocumentInformation;
import org.pdfbox.util.PDFTextStripper;
When I try to compile, it saws following error:
package org.pdfbox.pdfparser does not exist.
I have installed the default JDK on Ubuntu so how do I solve this issue?
This is not part of the default JDK installation. You need to get hold of the jar file that contains this code and then add it to your compile-time class path.
so, if you were to download the jar file to /tmp/pdfbox.jar, you'd compile it with
javac -cp .:/tmp/pdfbox.jar MyProgram.java
PS - downloading it to /tmp isn't a great idea, but you get the picture ......
you must build path it into your lib folder
go to your package explorer and right click on jar file and after that use build path