import package with script

hi guys, i want to import a unitypackage to my project. i use this code:

AssetDatabase.ImportPackage(Application.dataPath+“/package.unitypackage”,true);

but Nothing is added to the project

This is taken from the documentation:

Note: This is an editor class. To use it you have to place your script in
Assets/Editor inside your project folder. Editor classes are in the
UnityEditor namespace so for C# scripts you need to add “using
UnityEditor;” at the beginning of the script.

It means this is an editor script, not something you can use at run-time.

If you are using it in editor, then there might be something wrong with your path.